Sha256: 8d78a18db37529dba4d5f42ae28132c9a5697794371a575be830551d7acb16b4

Contents?: true

Size: 908 Bytes

Versions: 9

Compression:

Stored size: 908 Bytes

Contents

module Oschadbank
  class Client
    include Constants

    extend Dry::Initializer::Mixin

    option :api_url, default: proc { DEFAULT_API_URL }
    option :mac_key
    option :terminal_id
    option :merchant_id
    option :merchant_name
    option :merchant_url
    option :merchant_gmt
    option :country_code
    option :email, default: proc { nil }

    def pre_auth_params(args)
      ParamsBuilder.new(self, :pre_auth, args).build
    end

    def auth_params(args)
      ParamsBuilder.new(self, :auth, args).build
    end

    def charge(args)
      request_params = ParamsBuilder.new(self, :charge, args).build
      Request.new(api_url, request_params).perform
    end

    def refund(args)
      request_params = ParamsBuilder.new(self, :refund, args).build
      Request.new(api_url, request_params).perform
    end

    def response(params)
      Response.new(self, params)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
oschadbank-0.1.10 lib/oschadbank/client.rb
oschadbank-0.1.9 lib/oschadbank/client.rb
oschadbank-0.1.8 lib/oschadbank/client.rb
oschadbank-0.1.7 lib/oschadbank/client.rb
oschadbank-0.1.6 lib/oschadbank/client.rb
oschadbank-0.1.5 lib/oschadbank/client.rb
oschadbank-0.1.4 lib/oschadbank/client.rb
oschadbank-0.1.3 lib/oschadbank/client.rb
oschadbank-0.1.2 lib/oschadbank/client.rb