jamm 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/Gemfile.lock +2 -4
- data/README.md +24 -0
- data/Rakefile +7 -1
- data/lib/jamm/api/api/webhook_endpoint_api.rb +294 -0
- data/lib/jamm/api/models/charge_message_api_source.rb +42 -0
- data/lib/jamm/api/models/customer_service_update_customer_body.rb +1 -1
- data/lib/jamm/api/models/v1_buyer.rb +1 -1
- data/lib/jamm/api/models/v1_charge_message.rb +27 -4
- data/lib/jamm/api/models/v1_create_webhook_endpoint_request.rb +225 -0
- data/lib/jamm/api/models/v1_create_webhook_endpoint_response.rb +214 -0
- data/lib/jamm/api/models/v1_error_type.rb +2 -1
- data/lib/jamm/api/models/v1_initial_charge.rb +1 -1
- data/lib/jamm/api/models/v1_message_response.rb +13 -4
- data/lib/jamm/api/models/v1_on_session_payment_request.rb +12 -1
- data/lib/jamm/api/models/v1_promote_webhook_endpoint_response.rb +214 -0
- data/lib/jamm/api/models/v1_refund_info.rb +7 -7
- data/lib/jamm/api/models/v1_refund_webhook_content.rb +224 -0
- data/lib/jamm/api/models/v1_rollback_webhook_endpoint_response.rb +214 -0
- data/lib/jamm/api/models/v1_trigger_webhook_event_request.rb +238 -0
- data/lib/jamm/api/models/v1_trigger_webhook_event_response.rb +214 -0
- data/lib/jamm/api/models/v1_webhook_endpoint.rb +307 -0
- data/lib/jamm/api/models/v1_webhook_endpoint_status.rb +42 -0
- data/lib/jamm/api.rb +11 -0
- data/lib/jamm/api_version.rb +10 -0
- data/lib/jamm/client.rb +13 -1
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm/webhook.rb +157 -22
- data/lib/jamm.rb +24 -2
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b472b4eb5e6fce821a1f661259e31f08e223d7192d12be515c2a6229253a00b
|
|
4
|
+
data.tar.gz: cfe4d590089f2ba73b3f13f4fa96bf4d20df6c520f2194aa212d509d739f1c9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aaae08e45949517f521919d1f9c29ea9a79c72ac99cec017f07161218399d35a0519070b209acac3eee65ba34c2a55cedf92d6e5ec6dc30681400baaa4df98fb
|
|
7
|
+
data.tar.gz: 2eaaa934cf8227ab5d583d8d9d479a2a76679fad2f8f526b840efad9352d42e4c948e354fde16b9525cbb7b11d3b954e111658e32a27cb660bcf4fc623565d5e
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.7.0] - 2026-10-05
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Every request to the Jamm API (not OAuth token requests) sends a `Jamm-API-Version` header defaulting to the API version this SDK was built for (`Jamm::API_VERSION`). To stay on an older version, pass `api_version:` to `Jamm.configure`; a newer one needs an SDK upgrade.
|
|
13
|
+
- New error type `ERROR_TYPE_PAYMENT_CHARGE_OVER_DAILY_LIMIT`: the charge would exceed the daily limit of the buyer's bank account. Retry after midnight JST.
|
|
14
|
+
- Charge webhooks expose `msg.content.metadata`, the map you set when creating the charge, on every charge and refund event. Keys are symbols (`metadata[:order_id]`), and it is `nil` when the charge has none.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- The SDK version header is renamed from `X-SDK-Version` to `Jamm-SDK-Version`. If a proxy or firewall allowlists outgoing headers, add `Jamm-SDK-Version`.
|
|
19
|
+
- Webhook parsing accepts both `snake_case` and `camelCase` field names, so a future change to the webhook format won't break it.
|
|
20
|
+
|
|
21
|
+
### Deprecated
|
|
22
|
+
|
|
23
|
+
- `ERROR_TYPE_CSV_DUPLICATE_USER` is no longer returned.
|
|
24
|
+
|
|
25
|
+
## [2.6.0] - 2026-07-22
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Restored the forward-compatible `Jamm::Webhook.parse` first shipped in 2.3.0 (2.4.0 and 2.5.0 regressed to strict parsing):
|
|
30
|
+
- Webhook parsing no longer fails on new fields added by the backend (unknown fields are ignored instead of raising `ArgumentError`)
|
|
31
|
+
- Numeric enum wire values (`status`, …) resolve onto their string enum constants, matching REST API responses
|
|
32
|
+
- Refund webhooks expose the nested transaction fields, the refund's `rfd-` id (`refund_id` and `refund.id`), and typed nested models (`refund.error.code` works instead of raising `NoMethodError`)
|
|
33
|
+
- `EVENT_TYPE_USER_ACCOUNT_DELETED` webhooks parse (previously raised `Unknown event type`)
|
|
34
|
+
- `Webhook.parse` accepts payloads with either string or symbol keys
|
|
35
|
+
- `Webhook.parse` routes on the coerced event type, so event routing also survives a numeric `event_type` wire value
|
|
36
|
+
|
|
8
37
|
## [2.5.0] - 2026-07-03
|
|
9
38
|
|
|
10
39
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
jamm (2.
|
|
4
|
+
jamm (2.7.0)
|
|
5
5
|
base64 (~> 0.2)
|
|
6
6
|
rest-client (~> 2.0)
|
|
7
7
|
typhoeus (~> 1.0, >= 1.0.1)
|
|
@@ -24,9 +24,7 @@ GEM
|
|
|
24
24
|
ffi (>= 1.15.0)
|
|
25
25
|
faker (3.5.1)
|
|
26
26
|
i18n (>= 1.8.11, < 2)
|
|
27
|
-
ffi (1.17.0
|
|
28
|
-
ffi (1.17.0-arm64-darwin)
|
|
29
|
-
ffi (1.17.0-x86_64-linux-gnu)
|
|
27
|
+
ffi (1.17.0)
|
|
30
28
|
gimei (1.5.0)
|
|
31
29
|
hashdiff (1.1.0)
|
|
32
30
|
http-accept (1.7.0)
|
data/README.md
CHANGED
|
@@ -68,6 +68,30 @@ If you want to build the gem from source:
|
|
|
68
68
|
gem build jamm.gemspec
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
## API version
|
|
72
|
+
|
|
73
|
+
Every request to the Jamm API carries a `Jamm-API-Version` header. It defaults to
|
|
74
|
+
the dated API version this SDK was built against, exposed as `Jamm::API_VERSION`.
|
|
75
|
+
You can pin an older version with `api_version:` in `Jamm.configure`; a newer one
|
|
76
|
+
requires upgrading the SDK. Nil or empty means `Jamm::API_VERSION`.
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
Jamm.configure(client_id: '...', client_secret: '...', env: 'production', api_version: '2026-08-26')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The API rejects a version it no longer serves; the error lists the versions it does. Responses to a pinned older version follow that version's shape, so fields added since come back empty in this SDK's types.
|
|
83
|
+
|
|
84
|
+
Every versioned response echoes what served it in two headers:
|
|
85
|
+
`Jamm-API-Version` is the version, and `Jamm-API-Version-Source` is how it was
|
|
86
|
+
chosen: `header` (the version this SDK sent), `pin` (your account's pinned
|
|
87
|
+
version), `default` (no header, and no pin we could read), or `forced` (Jamm
|
|
88
|
+
temporarily served its newest shape, which no dated version describes, so
|
|
89
|
+
`Jamm-API-Version` is omitted). A request rejected before a version is chosen
|
|
90
|
+
carries neither.
|
|
91
|
+
|
|
92
|
+
OAuth2 token requests are excluded: they go to the identity service, which is
|
|
93
|
+
not versioned.
|
|
94
|
+
|
|
71
95
|
## Development
|
|
72
96
|
Test cases can be run with: `bundle exec rake`
|
|
73
97
|
|
data/Rakefile
CHANGED
|
@@ -6,7 +6,13 @@ require 'bundler/gem_tasks'
|
|
|
6
6
|
|
|
7
7
|
RuboCop::RakeTask.new
|
|
8
8
|
|
|
9
|
-
task default: %i[rubocop]
|
|
9
|
+
task default: %i[rubocop test]
|
|
10
|
+
|
|
11
|
+
desc 'Run unit tests'
|
|
12
|
+
Rake::TestTask.new(:test) do |t|
|
|
13
|
+
t.libs << 'lib'
|
|
14
|
+
t.pattern = './test/**/*_test.rb'
|
|
15
|
+
end
|
|
10
16
|
|
|
11
17
|
desc 'Run end-to-end tests'
|
|
12
18
|
Rake::TestTask.new(:e2e) do |t|
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Api
|
|
16
|
+
class WebhookEndpointApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create TEST webhook endpoint
|
|
23
|
+
# Create a TEST webhook endpoint pinned to a candidate API version. Real events are mirrored to it at that version.
|
|
24
|
+
# @param body [CreateWebhookEndpointRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [CreateWebhookEndpointResponse]
|
|
27
|
+
def create_webhook_endpoint(body, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_webhook_endpoint_with_http_info(body, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create TEST webhook endpoint
|
|
33
|
+
# Create a TEST webhook endpoint pinned to a candidate API version. Real events are mirrored to it at that version.
|
|
34
|
+
# @param body [CreateWebhookEndpointRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(CreateWebhookEndpointResponse, Integer, Hash)>] CreateWebhookEndpointResponse data, response status code and response headers
|
|
37
|
+
def create_webhook_endpoint_with_http_info(body, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: WebhookEndpointApi.create_webhook_endpoint ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'body' is set
|
|
42
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling WebhookEndpointApi.create_webhook_endpoint"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/webhook-endpoints'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateWebhookEndpointResponse'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || []
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"WebhookEndpointApi.create_webhook_endpoint",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: WebhookEndpointApi#create_webhook_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Promote webhook endpoint version
|
|
91
|
+
# Switch the LIVE webhook endpoint to the TEST endpoint's API version in one step and record the previous version.
|
|
92
|
+
# @param body [Object]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [PromoteWebhookEndpointResponse]
|
|
95
|
+
def promote_webhook_endpoint(body, opts = {})
|
|
96
|
+
data, _status_code, _headers = promote_webhook_endpoint_with_http_info(body, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Promote webhook endpoint version
|
|
101
|
+
# Switch the LIVE webhook endpoint to the TEST endpoint's API version in one step and record the previous version.
|
|
102
|
+
# @param body [Object]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(PromoteWebhookEndpointResponse, Integer, Hash)>] PromoteWebhookEndpointResponse data, response status code and response headers
|
|
105
|
+
def promote_webhook_endpoint_with_http_info(body, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: WebhookEndpointApi.promote_webhook_endpoint ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'body' is set
|
|
110
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling WebhookEndpointApi.promote_webhook_endpoint"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/webhook-endpoints/promote'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'PromoteWebhookEndpointResponse'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || []
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"WebhookEndpointApi.promote_webhook_endpoint",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: WebhookEndpointApi#promote_webhook_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Roll back webhook endpoint version
|
|
159
|
+
# Restore the LIVE webhook endpoint to the API version recorded at the last promote.
|
|
160
|
+
# @param body [Object]
|
|
161
|
+
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @return [RollbackWebhookEndpointResponse]
|
|
163
|
+
def rollback_webhook_endpoint(body, opts = {})
|
|
164
|
+
data, _status_code, _headers = rollback_webhook_endpoint_with_http_info(body, opts)
|
|
165
|
+
data
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Roll back webhook endpoint version
|
|
169
|
+
# Restore the LIVE webhook endpoint to the API version recorded at the last promote.
|
|
170
|
+
# @param body [Object]
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Array<(RollbackWebhookEndpointResponse, Integer, Hash)>] RollbackWebhookEndpointResponse data, response status code and response headers
|
|
173
|
+
def rollback_webhook_endpoint_with_http_info(body, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug 'Calling API: WebhookEndpointApi.rollback_webhook_endpoint ...'
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'body' is set
|
|
178
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling WebhookEndpointApi.rollback_webhook_endpoint"
|
|
180
|
+
end
|
|
181
|
+
# resource path
|
|
182
|
+
local_var_path = '/v1/webhook-endpoints/rollback'
|
|
183
|
+
|
|
184
|
+
# query parameters
|
|
185
|
+
query_params = opts[:query_params] || {}
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = opts[:header_params] || {}
|
|
189
|
+
# HTTP header 'Accept' (if needed)
|
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
191
|
+
# HTTP header 'Content-Type'
|
|
192
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
193
|
+
if !content_type.nil?
|
|
194
|
+
header_params['Content-Type'] = content_type
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# form parameters
|
|
198
|
+
form_params = opts[:form_params] || {}
|
|
199
|
+
|
|
200
|
+
# http body (model)
|
|
201
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
202
|
+
|
|
203
|
+
# return_type
|
|
204
|
+
return_type = opts[:debug_return_type] || 'RollbackWebhookEndpointResponse'
|
|
205
|
+
|
|
206
|
+
# auth_names
|
|
207
|
+
auth_names = opts[:debug_auth_names] || []
|
|
208
|
+
|
|
209
|
+
new_options = opts.merge(
|
|
210
|
+
:operation => :"WebhookEndpointApi.rollback_webhook_endpoint",
|
|
211
|
+
:header_params => header_params,
|
|
212
|
+
:query_params => query_params,
|
|
213
|
+
:form_params => form_params,
|
|
214
|
+
:body => post_body,
|
|
215
|
+
:auth_names => auth_names,
|
|
216
|
+
:return_type => return_type
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
220
|
+
if @api_client.config.debugging
|
|
221
|
+
@api_client.config.logger.debug "API called: WebhookEndpointApi#rollback_webhook_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
222
|
+
end
|
|
223
|
+
return data, status_code, headers
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Trigger a test webhook event
|
|
227
|
+
# Send one synthetic event of the given type to the TEST webhook endpoint, signed and versioned like a production delivery.
|
|
228
|
+
# @param body [TriggerWebhookEventRequest]
|
|
229
|
+
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @return [TriggerWebhookEventResponse]
|
|
231
|
+
def trigger_webhook_event(body, opts = {})
|
|
232
|
+
data, _status_code, _headers = trigger_webhook_event_with_http_info(body, opts)
|
|
233
|
+
data
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Trigger a test webhook event
|
|
237
|
+
# Send one synthetic event of the given type to the TEST webhook endpoint, signed and versioned like a production delivery.
|
|
238
|
+
# @param body [TriggerWebhookEventRequest]
|
|
239
|
+
# @param [Hash] opts the optional parameters
|
|
240
|
+
# @return [Array<(TriggerWebhookEventResponse, Integer, Hash)>] TriggerWebhookEventResponse data, response status code and response headers
|
|
241
|
+
def trigger_webhook_event_with_http_info(body, opts = {})
|
|
242
|
+
if @api_client.config.debugging
|
|
243
|
+
@api_client.config.logger.debug 'Calling API: WebhookEndpointApi.trigger_webhook_event ...'
|
|
244
|
+
end
|
|
245
|
+
# verify the required parameter 'body' is set
|
|
246
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
247
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling WebhookEndpointApi.trigger_webhook_event"
|
|
248
|
+
end
|
|
249
|
+
# resource path
|
|
250
|
+
local_var_path = '/v1/webhook-endpoints/trigger'
|
|
251
|
+
|
|
252
|
+
# query parameters
|
|
253
|
+
query_params = opts[:query_params] || {}
|
|
254
|
+
|
|
255
|
+
# header parameters
|
|
256
|
+
header_params = opts[:header_params] || {}
|
|
257
|
+
# HTTP header 'Accept' (if needed)
|
|
258
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
259
|
+
# HTTP header 'Content-Type'
|
|
260
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
261
|
+
if !content_type.nil?
|
|
262
|
+
header_params['Content-Type'] = content_type
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# form parameters
|
|
266
|
+
form_params = opts[:form_params] || {}
|
|
267
|
+
|
|
268
|
+
# http body (model)
|
|
269
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
270
|
+
|
|
271
|
+
# return_type
|
|
272
|
+
return_type = opts[:debug_return_type] || 'TriggerWebhookEventResponse'
|
|
273
|
+
|
|
274
|
+
# auth_names
|
|
275
|
+
auth_names = opts[:debug_auth_names] || []
|
|
276
|
+
|
|
277
|
+
new_options = opts.merge(
|
|
278
|
+
:operation => :"WebhookEndpointApi.trigger_webhook_event",
|
|
279
|
+
:header_params => header_params,
|
|
280
|
+
:query_params => query_params,
|
|
281
|
+
:form_params => form_params,
|
|
282
|
+
:body => post_body,
|
|
283
|
+
:auth_names => auth_names,
|
|
284
|
+
:return_type => return_type
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
288
|
+
if @api_client.config.debugging
|
|
289
|
+
@api_client.config.logger.debug "API called: WebhookEndpointApi#trigger_webhook_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
290
|
+
end
|
|
291
|
+
return data, status_code, headers
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Api
|
|
17
|
+
class ChargeMessageApiSource
|
|
18
|
+
UNSPECIFIED = "API_SOURCE_UNSPECIFIED".freeze
|
|
19
|
+
OFF_SESSION_SYNC = "API_SOURCE_OFF_SESSION_SYNC".freeze
|
|
20
|
+
OFF_SESSION_ASYNC = "API_SOURCE_OFF_SESSION_ASYNC".freeze
|
|
21
|
+
ON_SESSION = "API_SOURCE_ON_SESSION".freeze
|
|
22
|
+
|
|
23
|
+
def self.all_vars
|
|
24
|
+
@all_vars ||= [UNSPECIFIED, OFF_SESSION_SYNC, OFF_SESSION_ASYNC, ON_SESSION].freeze
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the enum from string
|
|
28
|
+
# @param [String] The enum value in the form of the string
|
|
29
|
+
# @return [String] The enum value
|
|
30
|
+
def self.build_from_hash(value)
|
|
31
|
+
new.build_from_hash(value)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Builds the enum from string
|
|
35
|
+
# @param [String] The enum value in the form of the string
|
|
36
|
+
# @return [String] The enum value
|
|
37
|
+
def build_from_hash(value)
|
|
38
|
+
return value if ChargeMessageApiSource.all_vars.include?(value)
|
|
39
|
+
raise "Invalid ENUM value #{value} for class #ChargeMessageApiSource"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -34,7 +34,7 @@ module Api
|
|
|
34
34
|
|
|
35
35
|
attr_accessor :gender
|
|
36
36
|
|
|
37
|
-
# Arbitrary key-value additional information about the customer. All the existing metadata will be overwritten by the new metadata. Customerに関する任意のキーと値の追加情報。 すべての既存のメタデータは新しいメタデータで上書きされます。
|
|
37
|
+
# Arbitrary key-value additional information about the customer. All the existing metadata will be overwritten by the new metadata. Customerに関する任意のキーと値の追加情報。 すべての既存のメタデータは新しいメタデータで上書きされます。 At most 50 entries; keys up to 64 and values up to 512 characters. 最大50件、キーは64文字、値は512文字までです。
|
|
38
38
|
attr_accessor :metadata
|
|
39
39
|
|
|
40
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -46,7 +46,7 @@ module Api
|
|
|
46
46
|
# Merchant can optionally set the expiry date for the contract. Defaults to 90 minutes if not specified. 決済の有効期限。未指定の場合は90分後に自動失効します。
|
|
47
47
|
attr_accessor :expires_at
|
|
48
48
|
|
|
49
|
-
# Arbitrary key-value additional information about the customer. You can see this information in our merchant dashboard. Customerに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。
|
|
49
|
+
# Arbitrary key-value additional information about the customer. You can see this information in our merchant dashboard. Customerに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。 At most 50 entries; keys up to 64 and values up to 512 characters. 最大50件、キーは64文字、値は512文字までです。
|
|
50
50
|
attr_accessor :metadata
|
|
51
51
|
|
|
52
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -62,6 +62,11 @@ module Api
|
|
|
62
62
|
|
|
63
63
|
attr_accessor :refund
|
|
64
64
|
|
|
65
|
+
attr_accessor :api_source
|
|
66
|
+
|
|
67
|
+
# Merchant-supplied metadata attached to the charge at creation, echoed back verbatim. Omitted when the charge carries no metadata.
|
|
68
|
+
attr_accessor :metadata
|
|
69
|
+
|
|
65
70
|
class EnumAttributeValidator
|
|
66
71
|
attr_reader :datatype
|
|
67
72
|
attr_reader :allowable_values
|
|
@@ -105,7 +110,9 @@ module Api
|
|
|
105
110
|
:'consumption_tax' => :'consumptionTax',
|
|
106
111
|
:'error' => :'error',
|
|
107
112
|
:'refund_id' => :'refundId',
|
|
108
|
-
:'refund' => :'refund'
|
|
113
|
+
:'refund' => :'refund',
|
|
114
|
+
:'api_source' => :'apiSource',
|
|
115
|
+
:'metadata' => :'metadata'
|
|
109
116
|
}
|
|
110
117
|
end
|
|
111
118
|
|
|
@@ -135,7 +142,9 @@ module Api
|
|
|
135
142
|
:'consumption_tax' => :'Integer',
|
|
136
143
|
:'error' => :'Apiv1Error',
|
|
137
144
|
:'refund_id' => :'String',
|
|
138
|
-
:'refund' => :'RefundInfo'
|
|
145
|
+
:'refund' => :'RefundInfo',
|
|
146
|
+
:'api_source' => :'ChargeMessageApiSource',
|
|
147
|
+
:'metadata' => :'Hash<String, String>'
|
|
139
148
|
}
|
|
140
149
|
end
|
|
141
150
|
|
|
@@ -237,6 +246,18 @@ module Api
|
|
|
237
246
|
if attributes.key?(:'refund')
|
|
238
247
|
self.refund = attributes[:'refund']
|
|
239
248
|
end
|
|
249
|
+
|
|
250
|
+
if attributes.key?(:'api_source')
|
|
251
|
+
self.api_source = attributes[:'api_source']
|
|
252
|
+
else
|
|
253
|
+
self.api_source = 'API_SOURCE_UNSPECIFIED'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
if attributes.key?(:'metadata')
|
|
257
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
258
|
+
self.metadata = value
|
|
259
|
+
end
|
|
260
|
+
end
|
|
240
261
|
end
|
|
241
262
|
|
|
242
263
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -277,7 +298,9 @@ module Api
|
|
|
277
298
|
consumption_tax == o.consumption_tax &&
|
|
278
299
|
error == o.error &&
|
|
279
300
|
refund_id == o.refund_id &&
|
|
280
|
-
refund == o.refund
|
|
301
|
+
refund == o.refund &&
|
|
302
|
+
api_source == o.api_source &&
|
|
303
|
+
metadata == o.metadata
|
|
281
304
|
end
|
|
282
305
|
|
|
283
306
|
# @see the `==` method
|
|
@@ -289,7 +312,7 @@ module Api
|
|
|
289
312
|
# Calculates hash code according to all attributes.
|
|
290
313
|
# @return [Integer] Hash code
|
|
291
314
|
def hash
|
|
292
|
-
[id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, jamm_fee, created_at, updated_at, original_transaction_jamm_fee, consumption_tax, error, refund_id, refund].hash
|
|
315
|
+
[id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, jamm_fee, created_at, updated_at, original_transaction_jamm_fee, consumption_tax, error, refund_id, refund, api_source, metadata].hash
|
|
293
316
|
end
|
|
294
317
|
|
|
295
318
|
# Builds the object from hash
|