jamm 2.6.0 → 2.8.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 +32 -0
- data/Gemfile.lock +2 -2
- data/README.md +39 -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 +24 -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_off_session_payment_request.rb +14 -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 +18 -8
- 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/models/v1_withdraw_request.rb +14 -4
- 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/errors.rb +51 -16
- data/lib/jamm/payment.rb +3 -1
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm/webhook.rb +17 -3
- data/lib/jamm.rb +24 -2
- metadata +14 -2
data/lib/jamm.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'date'
|
|
3
4
|
require 'rest-client'
|
|
4
5
|
require 'openssl'
|
|
5
6
|
require 'json'
|
|
6
7
|
|
|
8
|
+
require 'jamm/api_version'
|
|
7
9
|
require 'jamm/client'
|
|
8
10
|
require 'jamm/errors'
|
|
9
11
|
require 'jamm/oauth'
|
|
@@ -38,13 +40,33 @@ module Jamm
|
|
|
38
40
|
@max_retry = 0
|
|
39
41
|
|
|
40
42
|
class << self
|
|
41
|
-
attr_accessor :api, :client_id, :client_secret, :api_base, :environment, :mode, :oauth_base, :
|
|
43
|
+
attr_accessor :api, :client_id, :client_secret, :api_base, :environment, :mode, :oauth_base, :connect_base,
|
|
42
44
|
:openapi, :open_timeout, :read_timeout, :max_retry, :retry_initial_delay, :retry_max_delay
|
|
43
45
|
end
|
|
44
46
|
|
|
47
|
+
# The Jamm-API-Version sent on every request; defaults to the version this SDK was built against.
|
|
48
|
+
def self.api_version
|
|
49
|
+
@api_version || Jamm::API_VERSION
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.api_version=(version)
|
|
53
|
+
if version.nil? || version.to_s.empty?
|
|
54
|
+
@api_version = nil
|
|
55
|
+
return
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
version = version.to_s
|
|
59
|
+
raise ArgumentError, "invalid api_version \"#{version}\": expected YYYY-MM-DD" unless version.match?(/\A\d{4}-\d{2}-\d{2}\z/) && Date.valid_date?(*version.split('-').map(&:to_i))
|
|
60
|
+
raise ArgumentError, "api_version #{version} is newer than this SDK supports (#{Jamm::API_VERSION}); upgrade the SDK to use it" if version > Jamm::API_VERSION
|
|
61
|
+
|
|
62
|
+
@api_version = version
|
|
63
|
+
end
|
|
64
|
+
|
|
45
65
|
# Configure SDK with Client ID and Secret.
|
|
46
66
|
# Optionally enable `platform` for platformers to call Jamm API on behalf of their merchant.
|
|
47
|
-
|
|
67
|
+
# Optionally pin `api_version` (YYYY-MM-DD) to an API version older than the one this SDK was built against.
|
|
68
|
+
def self.configure(client_id:, client_secret:, env:, platform: false, api_version: nil)
|
|
69
|
+
self.api_version = api_version
|
|
48
70
|
Jamm.client_id = client_id
|
|
49
71
|
Jamm.client_secret = client_secret
|
|
50
72
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jamm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamm
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -78,12 +78,14 @@ files:
|
|
|
78
78
|
- lib/jamm/api/api/customer_api.rb
|
|
79
79
|
- lib/jamm/api/api/healthcheck_api.rb
|
|
80
80
|
- lib/jamm/api/api/payment_api.rb
|
|
81
|
+
- lib/jamm/api/api/webhook_endpoint_api.rb
|
|
81
82
|
- lib/jamm/api/api/webhook_service_api.rb
|
|
82
83
|
- lib/jamm/api/api_client.rb
|
|
83
84
|
- lib/jamm/api/api_error.rb
|
|
84
85
|
- lib/jamm/api/configuration.rb
|
|
85
86
|
- lib/jamm/api/models/apiv1_error.rb
|
|
86
87
|
- lib/jamm/api/models/apiv1_status.rb
|
|
88
|
+
- lib/jamm/api/models/charge_message_api_source.rb
|
|
87
89
|
- lib/jamm/api/models/customer_service_update_customer_body.rb
|
|
88
90
|
- lib/jamm/api/models/googlerpc_status.rb
|
|
89
91
|
- lib/jamm/api/models/protobuf_any.rb
|
|
@@ -112,6 +114,8 @@ files:
|
|
|
112
114
|
- lib/jamm/api/models/v1_create_contract_without_charge_response.rb
|
|
113
115
|
- lib/jamm/api/models/v1_create_customer_request.rb
|
|
114
116
|
- lib/jamm/api/models/v1_create_customer_response.rb
|
|
117
|
+
- lib/jamm/api/models/v1_create_webhook_endpoint_request.rb
|
|
118
|
+
- lib/jamm/api/models/v1_create_webhook_endpoint_response.rb
|
|
115
119
|
- lib/jamm/api/models/v1_customer.rb
|
|
116
120
|
- lib/jamm/api/models/v1_delete_customer_response.rb
|
|
117
121
|
- lib/jamm/api/models/v1_deposit_type.rb
|
|
@@ -145,14 +149,21 @@ files:
|
|
|
145
149
|
- lib/jamm/api/models/v1_payment_authorization_status.rb
|
|
146
150
|
- lib/jamm/api/models/v1_payment_link.rb
|
|
147
151
|
- lib/jamm/api/models/v1_ping_response.rb
|
|
152
|
+
- lib/jamm/api/models/v1_promote_webhook_endpoint_response.rb
|
|
148
153
|
- lib/jamm/api/models/v1_refund_info.rb
|
|
149
154
|
- lib/jamm/api/models/v1_refund_request.rb
|
|
150
155
|
- lib/jamm/api/models/v1_refund_response.rb
|
|
156
|
+
- lib/jamm/api/models/v1_refund_webhook_content.rb
|
|
157
|
+
- lib/jamm/api/models/v1_rollback_webhook_endpoint_response.rb
|
|
151
158
|
- lib/jamm/api/models/v1_search_banks_response.rb
|
|
152
159
|
- lib/jamm/api/models/v1_search_branches_response.rb
|
|
160
|
+
- lib/jamm/api/models/v1_trigger_webhook_event_request.rb
|
|
161
|
+
- lib/jamm/api/models/v1_trigger_webhook_event_response.rb
|
|
153
162
|
- lib/jamm/api/models/v1_update_customer_response.rb
|
|
154
163
|
- lib/jamm/api/models/v1_url.rb
|
|
155
164
|
- lib/jamm/api/models/v1_user_account_message.rb
|
|
165
|
+
- lib/jamm/api/models/v1_webhook_endpoint.rb
|
|
166
|
+
- lib/jamm/api/models/v1_webhook_endpoint_status.rb
|
|
156
167
|
- lib/jamm/api/models/v1_withdraw_async_request.rb
|
|
157
168
|
- lib/jamm/api/models/v1_withdraw_async_response.rb
|
|
158
169
|
- lib/jamm/api/models/v1_withdraw_async_status_request.rb
|
|
@@ -161,6 +172,7 @@ files:
|
|
|
161
172
|
- lib/jamm/api/models/v1_withdraw_response.rb
|
|
162
173
|
- lib/jamm/api/version.rb
|
|
163
174
|
- lib/jamm/api_patches.rb
|
|
175
|
+
- lib/jamm/api_version.rb
|
|
164
176
|
- lib/jamm/client.rb
|
|
165
177
|
- lib/jamm/customer.rb
|
|
166
178
|
- lib/jamm/deprecation.rb
|