Class: AllinpayCnp::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/allinpay_cnp/config.rb

Constant Summary collapse

ENVIRONMENTS =
%i[test production].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



10
11
12
13
# File 'lib/allinpay_cnp/config.rb', line 10

def initialize
  @environment = :test
  @timeout = 30
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



8
9
10
# File 'lib/allinpay_cnp/config.rb', line 8

def environment
  @environment
end

#inst_noObject

Returns the value of attribute inst_no.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def inst_no
  @inst_no
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def logger
  @logger
end

#merchant_idObject

Returns the value of attribute merchant_id.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def merchant_id
  @merchant_id
end

#private_keyObject

Returns the value of attribute private_key.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def private_key
  @private_key
end

#public_keyObject

Returns the value of attribute public_key.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def public_key
  @public_key
end

#timeoutObject

Returns the value of attribute timeout.



7
8
9
# File 'lib/allinpay_cnp/config.rb', line 7

def timeout
  @timeout
end

Instance Method Details

#production?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/allinpay_cnp/config.rb', line 26

def production?
  @environment == :production
end

#test?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/allinpay_cnp/config.rb', line 22

def test?
  @environment == :test
end