Module: Jamm
- Defined in:
- lib/jamm.rb,
lib/jamm/oauth.rb,
lib/jamm/charge.rb,
lib/jamm/client.rb,
lib/jamm/errors.rb,
lib/jamm/openapi.rb,
lib/jamm/version.rb,
lib/jamm/webhook.rb,
lib/jamm/contract.rb,
lib/jamm/customer.rb,
lib/jamm/healthcheck.rb
Overview
Jamm Ruby SDK
Defined Under Namespace
Modules: Charge, Client, Contract, Customer, Healthcheck, OAuth, OpenAPI, Webhook Classes: ApiError, InvalidSignatureError, JammError, OAuthError
Constant Summary collapse
- VERSION =
'1.2.2'
Class Attribute Summary collapse
-
.api ⇒ Object
Returns the value of attribute api.
-
.api_base ⇒ Object
Returns the value of attribute api_base.
-
.api_version ⇒ Object
Returns the value of attribute api_version.
-
.client_id ⇒ Object
Returns the value of attribute client_id.
-
.client_secret ⇒ Object
Returns the value of attribute client_secret.
-
.connect_base ⇒ Object
Returns the value of attribute connect_base.
-
.env ⇒ Object
Returns the value of attribute env.
-
.max_retry ⇒ Object
Returns the value of attribute max_retry.
-
.oauth_base ⇒ Object
Returns the value of attribute oauth_base.
-
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
.openapi ⇒ Object
Returns the value of attribute openapi.
-
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
.retry_initial_delay ⇒ Object
Returns the value of attribute retry_initial_delay.
-
.retry_max_delay ⇒ Object
Returns the value of attribute retry_max_delay.
Class Method Summary collapse
Class Attribute Details
.api ⇒ Object
Returns the value of attribute api.
33 34 35 |
# File 'lib/jamm.rb', line 33 def api @api end |
.api_base ⇒ Object
Returns the value of attribute api_base.
33 34 35 |
# File 'lib/jamm.rb', line 33 def api_base @api_base end |
.api_version ⇒ Object
Returns the value of attribute api_version.
33 34 35 |
# File 'lib/jamm.rb', line 33 def api_version @api_version end |
.client_id ⇒ Object
Returns the value of attribute client_id.
33 34 35 |
# File 'lib/jamm.rb', line 33 def client_id @client_id end |
.client_secret ⇒ Object
Returns the value of attribute client_secret.
33 34 35 |
# File 'lib/jamm.rb', line 33 def client_secret @client_secret end |
.connect_base ⇒ Object
Returns the value of attribute connect_base.
33 34 35 |
# File 'lib/jamm.rb', line 33 def connect_base @connect_base end |
.env ⇒ Object
Returns the value of attribute env.
33 34 35 |
# File 'lib/jamm.rb', line 33 def env @env end |
.max_retry ⇒ Object
Returns the value of attribute max_retry.
33 34 35 |
# File 'lib/jamm.rb', line 33 def max_retry @max_retry end |
.oauth_base ⇒ Object
Returns the value of attribute oauth_base.
33 34 35 |
# File 'lib/jamm.rb', line 33 def oauth_base @oauth_base end |
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
33 34 35 |
# File 'lib/jamm.rb', line 33 def open_timeout @open_timeout end |
.openapi ⇒ Object
Returns the value of attribute openapi.
33 34 35 |
# File 'lib/jamm.rb', line 33 def openapi @openapi end |
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
33 34 35 |
# File 'lib/jamm.rb', line 33 def read_timeout @read_timeout end |
.retry_initial_delay ⇒ Object
Returns the value of attribute retry_initial_delay.
33 34 35 |
# File 'lib/jamm.rb', line 33 def retry_initial_delay @retry_initial_delay end |
.retry_max_delay ⇒ Object
Returns the value of attribute retry_max_delay.
33 34 35 |
# File 'lib/jamm.rb', line 33 def retry_max_delay @retry_max_delay end |
Class Method Details
.configure(client_id:, client_secret:, env:) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/jamm.rb', line 37 def self.configure(client_id:, client_secret:, env:) Jamm.client_id = client_id Jamm.client_secret = client_secret case env when 'prd', 'prod', 'production' self.oauth_base = 'https://merchant-identity.jamm-pay.jp' self.openapi = Jamm::OpenAPI::ApiClient.new openapi.config.host = 'api.jamm-pay.jp' when 'local' self.oauth_base = 'https://merchant-identity.develop.jamm-pay.jp' self.openapi = Jamm::OpenAPI::ApiClient.new openapi.config.host = 'api.jamm.test' openapi.config.verify_ssl = false openapi.config.verify_ssl_host = false else self.oauth_base = "https://merchant-identity.#{env}.jamm-pay.jp" self.openapi = Jamm::OpenAPI::ApiClient.new openapi.config.host = "api.#{env}.jamm-pay.jp" end openapi.config.scheme = 'https' end |
.execute_request(option) ⇒ Object
65 66 67 |
# File 'lib/jamm.rb', line 65 def self.execute_request(option) RestClient::Request.execute(option) end |