Method: Allpay::Client#initialize

Defined in:
lib/allpay/client.rb

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/allpay/client.rb', line 20

def initialize options = {}
  @options = {mode: :production}.merge!(options)
  case @options[:mode]
  when :production
    option_required! :merchant_id, :hash_key, :hash_iv
  when :test
    @options = TEST_OPTIONS.merge(options)
  else
    raise InvalidMode, %Q{option :mode is either :test or :production}
  end
  @options.freeze
end