Class: Reapal::Client
- Inherits:
-
Object
- Object
- Reapal::Client
- Defined in:
- lib/reapal/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
- #decode_notify_data(encryptkey, data) ⇒ Object
-
#initialize(options_arg) ⇒ Client
constructor
A new instance of Client.
- #platform_contract ⇒ Object
Constructor Details
#initialize(options_arg) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/reapal/client.rb', line 9 def initialize() = Utils.symbolize_keys() @config = { server_url: [:server_url], partner_id: [:partner_id], merchant_id: [:merchant_id], md5_key: [:md5_key], private_key: OpenSSL::PKey::RSA.new([:private_key], [:private_key_pwd]), public_key: OpenSSL::X509::Certificate.new([:public_key]).public_key, } # 自动 include api 下的模块 recursive_include_api('Reapal::Api') # 自动 include form 下的模块 recursive_include_api('Reapal::Form') end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/reapal/client.rb', line 7 def config @config end |
Instance Method Details
#decode_notify_data(encryptkey, data) ⇒ Object
31 32 33 |
# File 'lib/reapal/client.rb', line 31 def decode_notify_data(encryptkey, data) ::Reapal::Http::Decode.decode_notify_data(encryptkey, data, @config) end |
#platform_contract ⇒ Object
26 27 28 29 |
# File 'lib/reapal/client.rb', line 26 def platform_contract # R+PARTNER "R#{@config[:partner_id]}" end |