Class: Bootpay::Api

Inherits:
Object
  • Object
show all
Includes:
Billing, Cancel, Easy, Escrow, Link, Naverpay, PaymentResource, Reseller, Rest, Submit, Token, Verification
Defined in:
lib/bootpay.rb,
lib/bootpay/bootpay.rb

Constant Summary collapse

API =
{
  development: 'https://dev-api.bootpay.co.kr/',
  stage:       'https://stage-api.bootpay.co.kr/',
  production:  'https://api.bootpay.co.kr/'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(application_id:, private_key:, mode: 'production') ⇒ Api

Returns a new instance of Api.

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
# File 'lib/bootpay.rb', line 40

def initialize(application_id:, private_key:, mode: 'production')

  @application_id = application_id
  @private_key    = private_key
  @mode           = mode.presence || 'production'
  @token          = nil
  raise ArgumentError, "개발환경 mode는 development, stage, production 중에서 선택이 가능합니다." if API[@mode.to_sym].blank?
end