Class: MomoPay::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  self.signature_verify_keys = MomoPay::Default::SIGNATURE_VERIFY_KEYS
  self.signature_confirm_keys = MomoPay::Default::SIGNATURE_CONFIRM_KEYS
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



4
5
6
# File 'lib/momo_pay/config.rb', line 4

def domain
  @domain
end

#partner_codeObject

Returns the value of attribute partner_code.



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

def partner_code
  @partner_code
end

#partner_nameObject

Returns the value of attribute partner_name.



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

def partner_name
  @partner_name
end

#public_keyObject

Returns the value of attribute public_key.



5
6
7
# File 'lib/momo_pay/config.rb', line 5

def public_key
  @public_key
end

#secret_keyObject

Returns the value of attribute secret_key.



6
7
8
# File 'lib/momo_pay/config.rb', line 6

def secret_key
  @secret_key
end

#signature_confirm_keysObject

Returns the value of attribute signature_confirm_keys.



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

def signature_confirm_keys
  @signature_confirm_keys
end

#signature_verify_keysObject

Returns the value of attribute signature_verify_keys.



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

def signature_verify_keys
  @signature_verify_keys
end

Instance Method Details

#public_key_pemObject



13
14
15
16
17
18
19
# File 'lib/momo_pay/config.rb', line 13

def public_key_pem
  @public_key_pem ||= [
    '-----BEGIN PUBLIC KEY-----',
    MomoPay.setup.public_key.split('').each_slice(64).map(&:join).join("\n"),
    '-----END PUBLIC KEY-----',
  ].join("\n")
end