checkout_sdk 1.1.3 → 1.1.5
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/README.md +5 -2
- data/lib/checkout_sdk/api_client.rb +1 -1
- data/lib/checkout_sdk/checkout_api.rb +7 -1
- data/lib/checkout_sdk/issuing/issuing.rb +3 -0
- data/lib/checkout_sdk/issuing/issuing_client.rb +166 -0
- data/lib/checkout_sdk/oauth_scopes.rb +4 -0
- data/lib/checkout_sdk/payments/contexts/payment_contexts_client.rb +25 -0
- data/lib/checkout_sdk/payments/payments.rb +3 -0
- data/lib/checkout_sdk/version.rb +1 -1
- data/lib/checkout_sdk.rb +1 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89b0d9812a4c443f439d78446f038e591d0b70285ffc1258d413bfe0966ec948
|
|
4
|
+
data.tar.gz: 56450b03be8537daab95e481f6eec23c2e147fff8f32a1d5c1ea0d2c98032428
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fddb2bbff3b40b6ef1a88843bdba5c7d10c5df3bfa87fea000e98ded9ca304f59e36daeb0397b07c61721790f9b507bd01d8b48ba2f65d708a8e04757298b862
|
|
7
|
+
data.tar.gz: 0f2deeabd4dfaf02ded2fee0ddf8054548369babd299993c62b5b5ad13e457416d1441abeacae06d6a5d38528f755bdf08a7d1882d7d7de368f861ed211f5bd6
|
data/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# Checkout.com Ruby SDK
|
|
2
|
+
[](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-master.yml)
|
|
3
|
+

|
|
2
4
|
|
|
3
|
-
](https://github.com/checkout/checkout-sdk-ruby/blob/master/LICENSE)
|
|
5
|
+
[](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-release.yml)
|
|
5
6
|
[](https://GitHub.com/checkout/checkout-sdk-ruby/releases/)
|
|
6
7
|
[](https://badge.fury.io/rb/checkout_sdk)
|
|
7
8
|
|
|
9
|
+
[](https://github.com/checkout/checkout-sdk-ruby/blob/master/LICENSE.md)
|
|
10
|
+
|
|
8
11
|
## Getting started
|
|
9
12
|
|
|
10
13
|
> **Version 1.0.0 is here!**
|
|
@@ -127,7 +127,7 @@ module CheckoutSdk
|
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def parse_response(response)
|
|
130
|
-
raise CheckoutApiException, response if response.status < 200 || response.status >=
|
|
130
|
+
raise CheckoutApiException, response if response.status < 200 || response.status >= 400
|
|
131
131
|
|
|
132
132
|
metadata = CheckoutUtils.map_to_http_metadata(response)
|
|
133
133
|
body = parse_json_or_contents(response)
|
|
@@ -37,6 +37,8 @@ module CheckoutSdk
|
|
|
37
37
|
# @return [CheckoutSdk::Metadata::MetadataClient]
|
|
38
38
|
# @!attribute financial
|
|
39
39
|
# @return [CheckoutSdk::Financial::FinancialClient]
|
|
40
|
+
# @!attribute issuing
|
|
41
|
+
# @return [CheckoutSdk::Issuing::IssuingClient]
|
|
40
42
|
class CheckoutApi
|
|
41
43
|
attr_reader :customers,
|
|
42
44
|
:disputes,
|
|
@@ -55,7 +57,9 @@ module CheckoutSdk
|
|
|
55
57
|
:balances,
|
|
56
58
|
:transfers,
|
|
57
59
|
:metadata,
|
|
58
|
-
:financial
|
|
60
|
+
:financial,
|
|
61
|
+
:issuing,
|
|
62
|
+
:contexts
|
|
59
63
|
|
|
60
64
|
# @param [CheckoutConfiguration] configuration
|
|
61
65
|
def initialize(configuration)
|
|
@@ -78,6 +82,8 @@ module CheckoutSdk
|
|
|
78
82
|
@transfers = CheckoutSdk::Transfers::TransfersClient.new(transfers_client(configuration), configuration)
|
|
79
83
|
@metadata = CheckoutSdk::Metadata::MetadataClient.new api_client, configuration
|
|
80
84
|
@financial = CheckoutSdk::Financial::FinancialClient.new api_client, configuration
|
|
85
|
+
@issuing = CheckoutSdk::Issuing::IssuingClient.new api_client, configuration
|
|
86
|
+
@contexts = CheckoutSdk::Payments::PaymentContextsClient.new api_client, configuration
|
|
81
87
|
end
|
|
82
88
|
|
|
83
89
|
private
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
class IssuingClient < Client
|
|
6
|
+
ISSUING = 'issuing'
|
|
7
|
+
CARDHOLDERS = 'cardholders'
|
|
8
|
+
CARDS = 'cards'
|
|
9
|
+
THREE_DS = '3ds-enrollment'
|
|
10
|
+
ACTIVATE = 'activate'
|
|
11
|
+
CREDENTIALS = 'credentials'
|
|
12
|
+
REVOKE = 'revoke'
|
|
13
|
+
SUSPEND = 'suspend'
|
|
14
|
+
CONTROLS = 'controls'
|
|
15
|
+
SIMULATE = 'simulate'
|
|
16
|
+
AUTHORIZATIONS = 'authorizations'
|
|
17
|
+
PRESENTMENTS = 'presentments'
|
|
18
|
+
REVERSALS = 'reversals'
|
|
19
|
+
private_constant :ISSUING,
|
|
20
|
+
:CARDHOLDERS,
|
|
21
|
+
:CARDS,
|
|
22
|
+
:THREE_DS,
|
|
23
|
+
:ACTIVATE,
|
|
24
|
+
:CREDENTIALS,
|
|
25
|
+
:REVOKE,
|
|
26
|
+
:SUSPEND,
|
|
27
|
+
:CONTROLS,
|
|
28
|
+
:SIMULATE,
|
|
29
|
+
:AUTHORIZATIONS,
|
|
30
|
+
:PRESENTMENTS,
|
|
31
|
+
:REVERSALS
|
|
32
|
+
|
|
33
|
+
# @param [ApiClient] api_client
|
|
34
|
+
# @param [CheckoutConfiguration] configuration
|
|
35
|
+
def initialize(api_client, configuration)
|
|
36
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# @param [Hash] cardholder_request
|
|
40
|
+
def create_cardholder(cardholder_request)
|
|
41
|
+
api_client.invoke_post(build_path(ISSUING, CARDHOLDERS), sdk_authorization, cardholder_request)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @param [String] cardholder_id
|
|
45
|
+
def get_cardholder(cardholder_id)
|
|
46
|
+
api_client.invoke_get(build_path(ISSUING, CARDHOLDERS, cardholder_id), sdk_authorization)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @param [String] cardholder_id
|
|
50
|
+
def get_cardholder_cards(cardholder_id)
|
|
51
|
+
api_client.invoke_get(build_path(ISSUING, CARDHOLDERS, cardholder_id, CARDS), sdk_authorization)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# @param [Hash] card_request
|
|
55
|
+
def create_card(card_request)
|
|
56
|
+
api_client.invoke_post(build_path(ISSUING, CARDS), sdk_authorization, card_request)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @param [String] card_id
|
|
60
|
+
def get_card_details(card_id)
|
|
61
|
+
api_client.invoke_get(build_path(ISSUING, CARDS, card_id), sdk_authorization)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# @param [String] card_id
|
|
65
|
+
# @param [Hash] three_ds_request
|
|
66
|
+
def enroll_three_ds(card_id, three_ds_request)
|
|
67
|
+
api_client.invoke_post(build_path(ISSUING, CARDS, card_id, THREE_DS), sdk_authorization, three_ds_request)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @param [String] card_id
|
|
71
|
+
# @param [Hash] three_ds_request
|
|
72
|
+
def update_three_ds_enrollment(card_id, three_ds_request)
|
|
73
|
+
api_client.invoke_patch(build_path(ISSUING, CARDS, card_id, THREE_DS), sdk_authorization, three_ds_request)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# @param [String] card_id
|
|
77
|
+
def get_card_three_ds_details(card_id)
|
|
78
|
+
api_client.invoke_get(build_path(ISSUING, CARDS, card_id, THREE_DS), sdk_authorization)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# @param [String] card_id
|
|
82
|
+
def activate_card(card_id)
|
|
83
|
+
api_client.invoke_post(build_path(ISSUING, CARDS, card_id, ACTIVATE), sdk_authorization)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @param [String] card_id
|
|
87
|
+
# @param [Hash] query
|
|
88
|
+
def get_card_credentials(card_id, query)
|
|
89
|
+
api_client.invoke_get(build_path(ISSUING, CARDS, card_id, CREDENTIALS), sdk_authorization, query)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# @param [String] card_id
|
|
93
|
+
# @param [Hash] revoke_request
|
|
94
|
+
def revoke_card(card_id, revoke_request)
|
|
95
|
+
api_client.invoke_post(build_path(ISSUING, CARDS, card_id, REVOKE), sdk_authorization, revoke_request)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# @param [String] card_id
|
|
99
|
+
# @param [Hash] suspend_request
|
|
100
|
+
def suspend_card(card_id, suspend_request)
|
|
101
|
+
api_client.invoke_post(build_path(ISSUING, CARDS, card_id, SUSPEND), sdk_authorization, suspend_request)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @param [Hash] control_request
|
|
105
|
+
def create_control(control_request)
|
|
106
|
+
api_client.invoke_post(build_path(ISSUING, CONTROLS), sdk_authorization, control_request)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# @param [Hash] controls_query
|
|
110
|
+
def get_card_controls(controls_query)
|
|
111
|
+
api_client.invoke_get(build_path(ISSUING, CONTROLS), sdk_authorization, controls_query)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# @param [String] control_id
|
|
115
|
+
def get_card_control_details(control_id)
|
|
116
|
+
api_client.invoke_get(build_path(ISSUING, CONTROLS, control_id), sdk_authorization)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @param [String] control_id
|
|
120
|
+
# @param [Hash] update_control_request
|
|
121
|
+
def update_card_control(control_id, update_control_request)
|
|
122
|
+
api_client.invoke_put(build_path(ISSUING, CONTROLS, control_id), sdk_authorization, update_control_request)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @param [String] control_id
|
|
126
|
+
def remove_card_control(control_id)
|
|
127
|
+
api_client.invoke_delete(build_path(ISSUING, CONTROLS, control_id), sdk_authorization)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# @param [Hash] authorization_request
|
|
131
|
+
def simulate_authorization(authorization_request)
|
|
132
|
+
api_client.invoke_post(build_path(ISSUING, SIMULATE, AUTHORIZATIONS), sdk_authorization, authorization_request)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @param [String] transaction_id
|
|
136
|
+
# @param [Hash] increment_request
|
|
137
|
+
def simulate_increment(transaction_id, increment_request)
|
|
138
|
+
api_client.invoke_post(
|
|
139
|
+
build_path(ISSUING, SIMULATE, AUTHORIZATIONS, transaction_id, AUTHORIZATIONS),
|
|
140
|
+
sdk_authorization,
|
|
141
|
+
increment_request
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# @param [String] transaction_id
|
|
146
|
+
# @param [Hash] clearing_request
|
|
147
|
+
def simulate_clearing(transaction_id, clearing_request)
|
|
148
|
+
api_client.invoke_post(
|
|
149
|
+
build_path(ISSUING, SIMULATE, AUTHORIZATIONS, transaction_id, PRESENTMENTS),
|
|
150
|
+
sdk_authorization,
|
|
151
|
+
clearing_request
|
|
152
|
+
)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# @param [String] transaction_id
|
|
156
|
+
# @param [Hash] reversal_request
|
|
157
|
+
def simulate_reversal(transaction_id, reversal_request)
|
|
158
|
+
api_client.invoke_post(
|
|
159
|
+
build_path(ISSUING, SIMULATE, AUTHORIZATIONS, transaction_id, REVERSALS),
|
|
160
|
+
sdk_authorization,
|
|
161
|
+
reversal_request
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
@@ -43,5 +43,9 @@ module CheckoutSdk
|
|
|
43
43
|
CARD_METADATA = 'vault:card-metadata'
|
|
44
44
|
FINANCIAL_ACTIONS = 'financial-actions'
|
|
45
45
|
FINANCIAL_ACTIONS_VIEW = 'financial-actions:view'
|
|
46
|
+
ISSUING_CLIENT = 'issuing:client'
|
|
47
|
+
ISSUING_CARD_MGMT = 'issuing:card-mgmt'
|
|
48
|
+
ISSUING_CONTROLS_READ = 'issuing:controls-read'
|
|
49
|
+
ISSUING_CONTROLS_WRITE = 'issuing:controls-write'
|
|
46
50
|
end
|
|
47
51
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Payments
|
|
5
|
+
class PaymentContextsClient < Client
|
|
6
|
+
PAYMENT_CONTEXTS = 'payment-contexts'
|
|
7
|
+
|
|
8
|
+
# @param [ApiClient] api_client
|
|
9
|
+
# @param [CheckoutConfiguration] configuration
|
|
10
|
+
def initialize(api_client, configuration)
|
|
11
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# @param [Hash] payment_contexts
|
|
15
|
+
def create_payment_contexts(payment_contexts)
|
|
16
|
+
api_client.invoke_post(PAYMENT_CONTEXTS, sdk_authorization, payment_contexts)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# @param [String] payment_context_id
|
|
20
|
+
def get_payment_context_details(payment_context_id)
|
|
21
|
+
api_client.invoke_get(build_path(PAYMENT_CONTEXTS, payment_context_id), sdk_authorization)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -155,3 +155,6 @@ require 'checkout_sdk/payments/hosted/hosted_payments_client'
|
|
|
155
155
|
# Payment Links
|
|
156
156
|
require 'checkout_sdk/payments/links/payment_link'
|
|
157
157
|
require 'checkout_sdk/payments/links/payments_links_client'
|
|
158
|
+
|
|
159
|
+
# Payment Contexts
|
|
160
|
+
require 'checkout_sdk/payments/contexts/payment_contexts_client'
|
data/lib/checkout_sdk/version.rb
CHANGED
data/lib/checkout_sdk.rb
CHANGED
|
@@ -64,6 +64,7 @@ require 'checkout_sdk/balances/balances'
|
|
|
64
64
|
require 'checkout_sdk/transfers/transfers'
|
|
65
65
|
require 'checkout_sdk/metadata/metadata'
|
|
66
66
|
require 'checkout_sdk/financial/financial'
|
|
67
|
+
require 'checkout_sdk/issuing/issuing'
|
|
67
68
|
|
|
68
69
|
# Checkout modules (previous)
|
|
69
70
|
require 'checkout_sdk/sources/sources'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: checkout_sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Checkout
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-12-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -243,6 +243,8 @@ files:
|
|
|
243
243
|
- lib/checkout_sdk/instruments/update/update_instrument_bank_account.rb
|
|
244
244
|
- lib/checkout_sdk/instruments/update/update_instrument_card.rb
|
|
245
245
|
- lib/checkout_sdk/instruments/update/update_instrument_token.rb
|
|
246
|
+
- lib/checkout_sdk/issuing/issuing.rb
|
|
247
|
+
- lib/checkout_sdk/issuing/issuing_client.rb
|
|
246
248
|
- lib/checkout_sdk/json_serializer.rb
|
|
247
249
|
- lib/checkout_sdk/metadata/metadata.rb
|
|
248
250
|
- lib/checkout_sdk/metadata/metadata_client.rb
|
|
@@ -268,6 +270,7 @@ files:
|
|
|
268
270
|
- lib/checkout_sdk/payments/capture_request.rb
|
|
269
271
|
- lib/checkout_sdk/payments/capture_type.rb
|
|
270
272
|
- lib/checkout_sdk/payments/charge_bearer.rb
|
|
273
|
+
- lib/checkout_sdk/payments/contexts/payment_contexts_client.rb
|
|
271
274
|
- lib/checkout_sdk/payments/d_local_installments.rb
|
|
272
275
|
- lib/checkout_sdk/payments/d_local_processing_settings.rb
|
|
273
276
|
- lib/checkout_sdk/payments/destination/bank_account_destination.rb
|