Sha256: 8c65a825464384d2436ef3d5bfd4d6b997e341096b493d5814d7459b89f3dc75

Contents?: true

Size: 898 Bytes

Versions: 2

Compression:

Stored size: 898 Bytes

Contents

module FakePin
  class Charge
    def self.create(params)
      new(params).create
    end

    def initialize(params)
      @params = params
    end

    def create
      @params.require(:amount, :description)
      currency = @params["currency"] || "AUD"

      { "token"                 => Token.generate('ch'),
        "success"               => true,
        "amount"                => @params['amount'],
        "description"           => @params['description'],
        "currency"              => currency,
        "ip_address"            => "203.192.1.172",
        "email"                 => @params['email'],
        "status_message"        => "Success!",
        "error_message"         => nil,
        "captured"              => true,
        "authorisation_expired" => false,
        "transfer"              => nil,
        "created_at"            => Time.now.to_s }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fake_pin-0.2 lib/fake_pin/charge.rb
fake_pin-0.0.1 lib/fake_pin/charge.rb