Sha256: f0f8a2939579f7f0700dc111d1a9bdadecb7f8b26725aaf85c5689968dac576f

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

module Fpswax
  class Session
    class ParameterRequired < ArgumentError; end

    API_VERSION = '2008-09-17'
    CBUI_API_VERSION = '2009-01-09'

    include Mixins::HmacSignature

    def initialize(access_key, secret_key, sandbox = true)
      @access_key = access_key
      @secret_key = secret_key
      @sandbox = sandbox
    end

    def in_sandbox?
      @sandbox
    end

    def api_version
      API_VERSION
    end

    def cbui_api_version
      CBUI_API_VERSION
    end

    # operations
    # See: http://docs.amazonwebservices.com/AmazonFPS/2008-09-17/FPSAdvancedGuide/Pay.html
    def pay(params)
      validate_required?(params,
                         :CallerReference,
                         :SenderTokenId,
                         :TransactionAmount)

      #get_response('Pay', PayResponse, params)
    end

    private
    def validate_required?(hash, *args)
      args.each do |arg|
        raise(ParameterRequired, "This method requires #{arg} to be passed in!") if !hash[arg]
      end
    end

    def make_request(params)

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dbalatero-fpswax-0.0.1 lib/fpswax/session.rb