Class: Bootpay::RestClient

Inherits:
Object
  • Object
show all
Includes:
Concern
Defined in:
lib/bootpay-backend-ruby.rb

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RestClient.

Raises:

  • (ArgumentError)


20
21
22
23
24
25
26
# File 'lib/bootpay-backend-ruby.rb', line 20

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