Class: JytPay::Client

Inherits:
Object
  • Object
show all
Includes:
Api::AuthCard, Api::QueryBalance, Api::QueryOrder, Api::QuickDraw, Api::QuickPay
Defined in:
lib/jyt_pay/client.rb

Constant Summary

Constants included from Api::AuthCard

Api::AuthCard::AUTH_CARD_TRAN_CODE

Constants included from Api::QueryBalance

Api::QueryBalance::QUERY_BALANCE_TRAN_CODE

Constants included from Api::QueryOrder

Api::QueryOrder::QUERY_DRAW_TRAN_CODE, Api::QueryOrder::QUERY_PAY_TRAN_CODE

Constants included from Api::QuickDraw

Api::QuickDraw::QUICK_DRAW_TRAN_CODE

Constants included from Api::QuickPay

Api::QuickPay::QUICK_PAY_TRAN_CODE

Instance Method Summary collapse

Methods included from Api::AuthCard

#auth_card

Methods included from Api::QueryBalance

#query_balance

Methods included from Api::QueryOrder

#query_order

Methods included from Api::QuickDraw

#quick_draw

Methods included from Api::QuickPay

#quick_pay

Constructor Details

#initialize(options_arg) ⇒ Client

Returns a new instance of Client



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jyt_pay/client.rb', line 17

def initialize(options_arg)
  options = Utils.symbolize_keys(options_arg)

  @uris = {
    pay: URI(options[:pay_url]),
    draw: URI(options[:draw_url]),
    auth: URI(options[:auth_url]),
    query_balance: URI(options[:query_balance_url]),
  }

  @merchant_id = options[:merchant_id]
  @mer_viral_acct = options[:mer_viral_acct]
  @private_key = options[:private_key]
  @jyt_public_key = options[:jyt_public_key]

  @rsa_private_key = OpenSSL::PKey::RSA.new(@private_key)
  @rsa_jyt_public_key = OpenSSL::PKey::RSA.new(@jyt_public_key)
end