Method: Ecpay::Client#initialize
- Defined in:
- lib/ecpay/client.rb
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ecpay/client.rb', line 21 def initialize( = {}) @options = { mode: :production }.merge!() case @options[:mode] when :production option_required! :merchant_id, :hash_key, :hash_iv when :test @options = TEST_OPTIONS.merge() else raise InvalidMode, %(option :mode is either :test or :production) end @options.freeze end |