Class: Bootpay::RestClient
- Inherits:
-
Object
- Object
- Bootpay::RestClient
- 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' }
- SDK_VERSION =
'4.2.1'
Instance Method Summary collapse
-
#initialize(application_id:, private_key:, mode: 'production') ⇒ RestClient
constructor
A new instance of RestClient.
-
#set_api_url(url) ⇒ Object
API URL을 변경 Comment by GOSOMI @date: 2023-05-26.
-
#set_api_version(version) ⇒ Object
API 버전을 설정한다 Comment by Gosomi Date: 2022-07-29.
Constructor Details
#initialize(application_id:, private_key:, mode: 'production') ⇒ RestClient
Returns a new instance of RestClient.
22 23 24 25 26 27 28 29 |
# File 'lib/bootpay-backend-ruby.rb', line 22 def initialize(application_id:, private_key:, mode: 'production') @application_id = application_id @private_key = private_key @mode = mode.presence || 'production' @token = nil @api_version = SDK_VERSION raise ArgumentError, "개발환경 mode는 development, stage, production 중에서 선택이 가능합니다." if API[@mode.to_sym].blank? end |
Instance Method Details
#set_api_url(url) ⇒ Object
API URL을 변경Comment by GOSOMI @date: 2023-05-26
34 35 36 |
# File 'lib/bootpay-backend-ruby.rb', line 34 def set_api_url(url) API[@mode.to_sym] = url end |
#set_api_version(version) ⇒ Object
API 버전을 설정한다Comment by Gosomi Date: 2022-07-29
41 42 43 44 |
# File 'lib/bootpay-backend-ruby.rb', line 41 def set_api_version(version) raise ArgumentError, 'API Version은 4.0.0 이상만 설정이 가능합니다.' if version < '4.0.0' @api_version = version end |