checkout_sdk 1.5.0 → 1.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/.rubocop.yml +15 -1
- data/lib/checkout_sdk/accounts/accounts.rb +10 -1
- data/lib/checkout_sdk/accounts/accounts_client.rb +134 -1
- data/lib/checkout_sdk/accounts/entity_files_request.rb +13 -0
- data/lib/checkout_sdk/accounts/entity_requirement_priority.rb +12 -0
- data/lib/checkout_sdk/accounts/entity_requirement_reason.rb +11 -0
- data/lib/checkout_sdk/accounts/entity_requirement_update_request.rb +22 -0
- data/lib/checkout_sdk/accounts/entity_requirement_update_status.rb +12 -0
- data/lib/checkout_sdk/accounts/onboard_entity.rb +9 -1
- data/lib/checkout_sdk/accounts/reserve_rule_create_request.rb +14 -0
- data/lib/checkout_sdk/accounts/reserve_rule_holding_duration.rb +13 -0
- data/lib/checkout_sdk/accounts/reserve_rule_update_request.rb +15 -0
- data/lib/checkout_sdk/accounts/rolling_reserve_rule.rb +15 -0
- data/lib/checkout_sdk/accounts/submitter.rb +13 -0
- data/lib/checkout_sdk/agentic_commerce/agentic_commerce.rb +8 -0
- data/lib/checkout_sdk/agentic_commerce/agentic_commerce_client.rb +31 -0
- data/lib/checkout_sdk/agentic_commerce/delegated_payment_allowance.rb +28 -0
- data/lib/checkout_sdk/agentic_commerce/delegated_payment_billing_address.rb +33 -0
- data/lib/checkout_sdk/agentic_commerce/delegated_payment_method_card.rb +64 -0
- data/lib/checkout_sdk/agentic_commerce/delegated_payment_request.rb +25 -0
- data/lib/checkout_sdk/agentic_commerce/delegated_payment_risk_signal.rb +20 -0
- data/lib/checkout_sdk/api_client.rb +25 -15
- data/lib/checkout_sdk/balances/balance_values.rb +28 -0
- data/lib/checkout_sdk/balances/balances.rb +4 -0
- data/lib/checkout_sdk/balances/balances_query.rb +32 -0
- data/lib/checkout_sdk/balances/collateral_breakdown.rb +16 -0
- data/lib/checkout_sdk/balances/currency_account_balance.rb +26 -0
- data/lib/checkout_sdk/checkout_api.rb +61 -1
- data/lib/checkout_sdk/common/common.rb +1 -0
- data/lib/checkout_sdk/common/headers.rb +16 -0
- data/lib/checkout_sdk/common/payment_source_type.rb +1 -0
- data/lib/checkout_sdk/compliance_requests/compliance_request_responded_field.rb +22 -0
- data/lib/checkout_sdk/compliance_requests/compliance_request_responded_fields.rb +15 -0
- data/lib/checkout_sdk/compliance_requests/compliance_requests.rb +6 -0
- data/lib/checkout_sdk/compliance_requests/compliance_requests_client.rb +34 -0
- data/lib/checkout_sdk/compliance_requests/compliance_response_request.rb +16 -0
- data/lib/checkout_sdk/disputes/dispute_status.rb +1 -0
- data/lib/checkout_sdk/disputes/disputes_client.rb +22 -1
- data/lib/checkout_sdk/disputes/disputes_query_filter.rb +49 -11
- data/lib/checkout_sdk/forward/create_secret_request.rb +17 -0
- data/lib/checkout_sdk/forward/forward.rb +2 -0
- data/lib/checkout_sdk/forward/forward_client.rb +27 -1
- data/lib/checkout_sdk/forward/update_secret_request.rb +15 -0
- data/lib/checkout_sdk/identities/aml_screening/aml_screening_client.rb +29 -0
- data/lib/checkout_sdk/identities/aml_screening/aml_search_parameters.rb +15 -0
- data/lib/checkout_sdk/identities/aml_screening/aml_verification_request.rb +19 -0
- data/lib/checkout_sdk/identities/applicants/applicants_client.rb +43 -0
- data/lib/checkout_sdk/identities/applicants/create_applicant_request.rb +21 -0
- data/lib/checkout_sdk/identities/applicants/update_applicant_request.rb +18 -0
- data/lib/checkout_sdk/identities/face_authentication/face_authentication_attempt_request.rb +17 -0
- data/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +68 -0
- data/lib/checkout_sdk/identities/face_authentication/face_authentication_request.rb +21 -0
- data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_client.rb +77 -0
- data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_request.rb +27 -0
- data/lib/checkout_sdk/identities/identities.rb +27 -0
- data/lib/checkout_sdk/identities/identity_verification/identity_verification_attempt_request.rb +17 -0
- data/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +84 -0
- data/lib/checkout_sdk/identities/identity_verification/identity_verification_request.rb +21 -0
- data/lib/checkout_sdk/identities/identity_verification/idv_client_information.rb +17 -0
- data/lib/checkout_sdk/identities/identity_verification/idv_declared_data.rb +15 -0
- data/lib/checkout_sdk/instruments/base_instruments_client.rb +9 -0
- data/lib/checkout_sdk/issuing/add_control_group_request.rb +19 -0
- data/lib/checkout_sdk/issuing/add_control_profile_request.rb +13 -0
- data/lib/checkout_sdk/issuing/cardholder_access_token_request.rb +26 -0
- data/lib/checkout_sdk/issuing/create_dispute_request.rb +24 -0
- data/lib/checkout_sdk/issuing/escalate_dispute_request.rb +19 -0
- data/lib/checkout_sdk/issuing/identification_document.rb +18 -0
- data/lib/checkout_sdk/issuing/issuing.rb +25 -0
- data/lib/checkout_sdk/issuing/issuing_address.rb +25 -0
- data/lib/checkout_sdk/issuing/issuing_client.rb +266 -13
- data/lib/checkout_sdk/issuing/issuing_phone_number.rb +16 -0
- data/lib/checkout_sdk/issuing/oob_authentication_request.rb +15 -0
- data/lib/checkout_sdk/issuing/oob_simulate_transaction_details.rb +19 -0
- data/lib/checkout_sdk/issuing/schedule_revocation_request.rb +13 -0
- data/lib/checkout_sdk/issuing/simulate_refund_request.rb +13 -0
- data/lib/checkout_sdk/issuing/update_card_request.rb +19 -0
- data/lib/checkout_sdk/issuing/update_cardholder_request.rb +32 -0
- data/lib/checkout_sdk/issuing/update_control_profile_request.rb +13 -0
- data/lib/checkout_sdk/network_tokens/network_token_cryptogram_request.rb +13 -0
- data/lib/checkout_sdk/network_tokens/network_token_source_card.rb +25 -0
- data/lib/checkout_sdk/network_tokens/network_token_source_id.rb +19 -0
- data/lib/checkout_sdk/network_tokens/network_tokens.rb +7 -0
- data/lib/checkout_sdk/network_tokens/network_tokens_client.rb +51 -0
- data/lib/checkout_sdk/network_tokens/provision_network_token_request.rb +14 -0
- data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator.rb +6 -0
- data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb +72 -0
- data/lib/checkout_sdk/onboarding_simulator/simulator_entity_status.rb +16 -0
- data/lib/checkout_sdk/onboarding_simulator/simulator_set_requirements_due_request.rb +14 -0
- data/lib/checkout_sdk/onboarding_simulator/simulator_set_status_request.rb +13 -0
- data/lib/checkout_sdk/payment_methods/payment_methods.rb +4 -0
- data/lib/checkout_sdk/payment_methods/payment_methods_client.rb +24 -0
- data/lib/checkout_sdk/payment_methods/payment_methods_query.rb +13 -0
- data/lib/checkout_sdk/payments/apple_pay/apple_pay_certificate_request.rb +13 -0
- data/lib/checkout_sdk/payments/apple_pay/apple_pay_client.rb +44 -0
- data/lib/checkout_sdk/payments/apple_pay/apple_pay_enrollment_request.rb +13 -0
- data/lib/checkout_sdk/payments/apple_pay/apple_pay_signing_request.rb +13 -0
- data/lib/checkout_sdk/payments/base_payments_client.rb +19 -0
- data/lib/checkout_sdk/payments/cancellation_request.rb +13 -0
- data/lib/checkout_sdk/payments/flow/flow_client.rb +59 -0
- data/lib/checkout_sdk/payments/google_pay/google_pay_client.rb +48 -0
- data/lib/checkout_sdk/payments/google_pay/google_pay_domain_request.rb +13 -0
- data/lib/checkout_sdk/payments/google_pay/google_pay_enrollment_request.rb +17 -0
- data/lib/checkout_sdk/payments/passenger.rb +20 -6
- data/lib/checkout_sdk/payments/payment_plan.rb +43 -0
- data/lib/checkout_sdk/payments/payment_request.rb +2 -1
- data/lib/checkout_sdk/payments/payments.rb +26 -1
- data/lib/checkout_sdk/payments/payments_search_request.rb +20 -0
- data/lib/checkout_sdk/payments/processing_data.rb +45 -0
- data/lib/checkout_sdk/payments/processing_settings.rb +5 -1
- data/lib/checkout_sdk/payments/sessions/payment_sessions_client.rb +12 -0
- data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification.rb +17 -0
- data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification_type.rb +15 -0
- data/lib/checkout_sdk/payments/setups/account_funding_transaction_purpose.rb +29 -0
- data/lib/checkout_sdk/payments/setups/account_funding_transaction_recipient.rb +26 -0
- data/lib/checkout_sdk/payments/setups/account_funding_transaction_sender.rb +29 -0
- data/lib/checkout_sdk/payments/setups/blik_payment_method.rb +20 -0
- data/lib/checkout_sdk/payments/setups/payment_setup_account_funding_transaction.rb +20 -0
- data/lib/checkout_sdk/payments/source/apm/blik_source.rb +31 -0
- data/lib/checkout_sdk/sessions/device_information.rb +17 -0
- data/lib/checkout_sdk/sessions/session_request.rb +2 -1
- data/lib/checkout_sdk/sessions/sessions.rb +1 -0
- data/lib/checkout_sdk/standalone_account_updater/account_updater_card.rb +17 -0
- data/lib/checkout_sdk/standalone_account_updater/account_updater_instrument.rb +13 -0
- data/lib/checkout_sdk/standalone_account_updater/account_updater_request.rb +13 -0
- data/lib/checkout_sdk/standalone_account_updater/account_updater_source_options.rb +15 -0
- data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater.rb +7 -0
- data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater_client.rb +29 -0
- data/lib/checkout_sdk/tokens/token_metadata_billing_address.rb +16 -0
- data/lib/checkout_sdk/tokens/token_metadata_response.rb +55 -0
- data/lib/checkout_sdk/tokens/tokens.rb +2 -0
- data/lib/checkout_sdk/tokens/tokens_client.rb +11 -0
- data/lib/checkout_sdk/version.rb +1 -1
- data/lib/checkout_sdk/workflows/workflows_client.rb +1 -1
- data/lib/checkout_sdk.rb +7 -0
- metadata +106 -4
- data/lib/checkout_sdk/accounts/headers.rb +0 -11
- data/lib/checkout_sdk/payments/passenger_name.rb +0 -11
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# Authentication
|
|
4
|
+
require 'checkout_sdk/issuing/cardholder_access_token_request'
|
|
5
|
+
require 'checkout_sdk/issuing/oob_simulate_transaction_details'
|
|
6
|
+
require 'checkout_sdk/issuing/oob_authentication_request'
|
|
7
|
+
|
|
8
|
+
# Cardholders / Cards updates
|
|
9
|
+
require 'checkout_sdk/issuing/issuing_phone_number'
|
|
10
|
+
require 'checkout_sdk/issuing/issuing_address'
|
|
11
|
+
require 'checkout_sdk/issuing/identification_document'
|
|
12
|
+
require 'checkout_sdk/issuing/update_cardholder_request'
|
|
13
|
+
require 'checkout_sdk/issuing/update_card_request'
|
|
14
|
+
require 'checkout_sdk/issuing/schedule_revocation_request'
|
|
15
|
+
|
|
16
|
+
# Simulations
|
|
17
|
+
require 'checkout_sdk/issuing/simulate_refund_request'
|
|
18
|
+
|
|
19
|
+
# Controls
|
|
20
|
+
require 'checkout_sdk/issuing/add_control_group_request'
|
|
21
|
+
require 'checkout_sdk/issuing/add_control_profile_request'
|
|
22
|
+
require 'checkout_sdk/issuing/update_control_profile_request'
|
|
23
|
+
|
|
24
|
+
# Disputes
|
|
25
|
+
require 'checkout_sdk/issuing/create_dispute_request'
|
|
26
|
+
require 'checkout_sdk/issuing/escalate_dispute_request'
|
|
27
|
+
|
|
3
28
|
require 'checkout_sdk/issuing/issuing_client'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Address block used in Issuing requests (billing/residency on cardholders).
|
|
6
|
+
# Matches swagger `IssuingAddress`. `address_line1`, `city`, `zip`, `country`
|
|
7
|
+
# are required per spec; other fields are optional.
|
|
8
|
+
#
|
|
9
|
+
# @!attribute address_line1
|
|
10
|
+
# @return [String] [Required]
|
|
11
|
+
# @!attribute address_line2
|
|
12
|
+
# @return [String]
|
|
13
|
+
# @!attribute city
|
|
14
|
+
# @return [String] [Required]
|
|
15
|
+
# @!attribute state
|
|
16
|
+
# @return [String]
|
|
17
|
+
# @!attribute zip
|
|
18
|
+
# @return [String] [Required]
|
|
19
|
+
# @!attribute country
|
|
20
|
+
# @return [String] ISO-3166 alpha-2 country code. [Required]
|
|
21
|
+
class IssuingAddress
|
|
22
|
+
attr_accessor :address_line1, :address_line2, :city, :state, :zip, :country
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -12,23 +12,32 @@ module CheckoutSdk
|
|
|
12
12
|
REVOKE = 'revoke'
|
|
13
13
|
SUSPEND = 'suspend'
|
|
14
14
|
CONTROLS = 'controls'
|
|
15
|
+
CONTROL_GROUPS = 'control-groups'
|
|
16
|
+
CONTROL_PROFILES = 'control-profiles'
|
|
15
17
|
SIMULATE = 'simulate'
|
|
16
18
|
AUTHORIZATIONS = 'authorizations'
|
|
17
19
|
PRESENTMENTS = 'presentments'
|
|
18
20
|
REVERSALS = 'reversals'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
REFUNDS = 'refunds'
|
|
22
|
+
RENEW = 'renew'
|
|
23
|
+
SCHEDULE_REVOCATION = 'schedule-revocation'
|
|
24
|
+
DISPUTES = 'disputes'
|
|
25
|
+
CANCEL = 'cancel'
|
|
26
|
+
ESCALATE = 'escalate'
|
|
27
|
+
TRANSACTIONS = 'transactions'
|
|
28
|
+
DIGITAL_CARDS = 'digital-cards'
|
|
29
|
+
ADD = 'add'
|
|
30
|
+
REMOVE = 'remove'
|
|
31
|
+
ACCESS = 'access'
|
|
32
|
+
CONNECT = 'connect'
|
|
33
|
+
TOKEN = 'token'
|
|
34
|
+
OOB = 'oob'
|
|
35
|
+
AUTHENTICATION = 'authentication'
|
|
36
|
+
private_constant :ISSUING, :CARDHOLDERS, :CARDS, :THREE_DS, :ACTIVATE, :CREDENTIALS,
|
|
37
|
+
:REVOKE, :SUSPEND, :CONTROLS, :CONTROL_GROUPS, :CONTROL_PROFILES,
|
|
38
|
+
:SIMULATE, :AUTHORIZATIONS, :PRESENTMENTS, :REVERSALS, :REFUNDS,
|
|
39
|
+
:RENEW, :SCHEDULE_REVOCATION, :DISPUTES, :CANCEL, :ESCALATE,
|
|
40
|
+
:TRANSACTIONS, :DIGITAL_CARDS, :ADD, :REMOVE
|
|
32
41
|
|
|
33
42
|
# @param [ApiClient] api_client
|
|
34
43
|
# @param [CheckoutConfiguration] configuration
|
|
@@ -36,6 +45,8 @@ module CheckoutSdk
|
|
|
36
45
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
37
46
|
end
|
|
38
47
|
|
|
48
|
+
# ====== Cardholders ======
|
|
49
|
+
|
|
39
50
|
# @param [Hash] cardholder_request
|
|
40
51
|
def create_cardholder(cardholder_request)
|
|
41
52
|
api_client.invoke_post(build_path(ISSUING, CARDHOLDERS), sdk_authorization, cardholder_request)
|
|
@@ -46,11 +57,23 @@ module CheckoutSdk
|
|
|
46
57
|
api_client.invoke_get(build_path(ISSUING, CARDHOLDERS, cardholder_id), sdk_authorization)
|
|
47
58
|
end
|
|
48
59
|
|
|
60
|
+
# @param [String] cardholder_id
|
|
61
|
+
# @param [Hash, UpdateCardholderRequest] update_cardholder_request
|
|
62
|
+
def update_cardholder(cardholder_id, update_cardholder_request)
|
|
63
|
+
api_client.invoke_patch(
|
|
64
|
+
build_path(ISSUING, CARDHOLDERS, cardholder_id),
|
|
65
|
+
sdk_authorization,
|
|
66
|
+
update_cardholder_request
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
49
70
|
# @param [String] cardholder_id
|
|
50
71
|
def get_cardholder_cards(cardholder_id)
|
|
51
72
|
api_client.invoke_get(build_path(ISSUING, CARDHOLDERS, cardholder_id, CARDS), sdk_authorization)
|
|
52
73
|
end
|
|
53
74
|
|
|
75
|
+
# ====== Cards ======
|
|
76
|
+
|
|
54
77
|
# @param [Hash] card_request
|
|
55
78
|
def create_card(card_request)
|
|
56
79
|
api_client.invoke_post(build_path(ISSUING, CARDS), sdk_authorization, card_request)
|
|
@@ -61,6 +84,16 @@ module CheckoutSdk
|
|
|
61
84
|
api_client.invoke_get(build_path(ISSUING, CARDS, card_id), sdk_authorization)
|
|
62
85
|
end
|
|
63
86
|
|
|
87
|
+
# @param [String] card_id
|
|
88
|
+
# @param [Hash, UpdateCardRequest] update_card_request
|
|
89
|
+
def update_card(card_id, update_card_request)
|
|
90
|
+
api_client.invoke_patch(
|
|
91
|
+
build_path(ISSUING, CARDS, card_id),
|
|
92
|
+
sdk_authorization,
|
|
93
|
+
update_card_request
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
64
97
|
# @param [String] card_id
|
|
65
98
|
# @param [Hash] three_ds_request
|
|
66
99
|
def enroll_three_ds(card_id, three_ds_request)
|
|
@@ -101,6 +134,39 @@ module CheckoutSdk
|
|
|
101
134
|
api_client.invoke_post(build_path(ISSUING, CARDS, card_id, SUSPEND), sdk_authorization, suspend_request)
|
|
102
135
|
end
|
|
103
136
|
|
|
137
|
+
# Renew a card. POST /issuing/cards/{cardId}/renew.
|
|
138
|
+
# @param [String] card_id
|
|
139
|
+
# @param [Hash] renew_request
|
|
140
|
+
def renew_card(card_id, renew_request = nil)
|
|
141
|
+
api_client.invoke_post(
|
|
142
|
+
build_path(ISSUING, CARDS, card_id, RENEW),
|
|
143
|
+
sdk_authorization,
|
|
144
|
+
renew_request
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Schedule a card revocation. POST /issuing/cards/{cardId}/schedule-revocation.
|
|
149
|
+
# @param [String] card_id
|
|
150
|
+
# @param [Hash, ScheduleRevocationRequest] schedule_revocation_request
|
|
151
|
+
def schedule_card_revocation(card_id, schedule_revocation_request)
|
|
152
|
+
api_client.invoke_post(
|
|
153
|
+
build_path(ISSUING, CARDS, card_id, SCHEDULE_REVOCATION),
|
|
154
|
+
sdk_authorization,
|
|
155
|
+
schedule_revocation_request
|
|
156
|
+
)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Cancel a scheduled card revocation. DELETE /issuing/cards/{cardId}/schedule-revocation.
|
|
160
|
+
# @param [String] card_id
|
|
161
|
+
def cancel_scheduled_card_revocation(card_id)
|
|
162
|
+
api_client.invoke_delete(
|
|
163
|
+
build_path(ISSUING, CARDS, card_id, SCHEDULE_REVOCATION),
|
|
164
|
+
sdk_authorization
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# ====== Controls (legacy single endpoint) ======
|
|
169
|
+
|
|
104
170
|
# @param [Hash] control_request
|
|
105
171
|
def create_control(control_request)
|
|
106
172
|
api_client.invoke_post(build_path(ISSUING, CONTROLS), sdk_authorization, control_request)
|
|
@@ -127,6 +193,161 @@ module CheckoutSdk
|
|
|
127
193
|
api_client.invoke_delete(build_path(ISSUING, CONTROLS, control_id), sdk_authorization)
|
|
128
194
|
end
|
|
129
195
|
|
|
196
|
+
# ====== Control Groups ======
|
|
197
|
+
|
|
198
|
+
# @param [Hash, AddControlGroupRequest] control_group_request
|
|
199
|
+
def create_control_group(control_group_request)
|
|
200
|
+
api_client.invoke_post(
|
|
201
|
+
build_path(ISSUING, CONTROLS, CONTROL_GROUPS),
|
|
202
|
+
sdk_authorization,
|
|
203
|
+
control_group_request
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def get_control_groups
|
|
208
|
+
api_client.invoke_get(build_path(ISSUING, CONTROLS, CONTROL_GROUPS), sdk_authorization)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# @param [String] control_group_id
|
|
212
|
+
def get_control_group(control_group_id)
|
|
213
|
+
api_client.invoke_get(
|
|
214
|
+
build_path(ISSUING, CONTROLS, CONTROL_GROUPS, control_group_id),
|
|
215
|
+
sdk_authorization
|
|
216
|
+
)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# @param [String] control_group_id
|
|
220
|
+
def delete_control_group(control_group_id)
|
|
221
|
+
api_client.invoke_delete(
|
|
222
|
+
build_path(ISSUING, CONTROLS, CONTROL_GROUPS, control_group_id),
|
|
223
|
+
sdk_authorization
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# ====== Control Profiles ======
|
|
228
|
+
|
|
229
|
+
# @param [Hash, AddControlProfileRequest] control_profile_request
|
|
230
|
+
def create_control_profile(control_profile_request)
|
|
231
|
+
api_client.invoke_post(
|
|
232
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES),
|
|
233
|
+
sdk_authorization,
|
|
234
|
+
control_profile_request
|
|
235
|
+
)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def get_control_profiles
|
|
239
|
+
api_client.invoke_get(build_path(ISSUING, CONTROLS, CONTROL_PROFILES), sdk_authorization)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# @param [String] control_profile_id
|
|
243
|
+
def get_control_profile(control_profile_id)
|
|
244
|
+
api_client.invoke_get(
|
|
245
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES, control_profile_id),
|
|
246
|
+
sdk_authorization
|
|
247
|
+
)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# @param [String] control_profile_id
|
|
251
|
+
# @param [Hash, UpdateControlProfileRequest] update_control_profile_request
|
|
252
|
+
def update_control_profile(control_profile_id, update_control_profile_request)
|
|
253
|
+
api_client.invoke_patch(
|
|
254
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES, control_profile_id),
|
|
255
|
+
sdk_authorization,
|
|
256
|
+
update_control_profile_request
|
|
257
|
+
)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @param [String] control_profile_id
|
|
261
|
+
def delete_control_profile(control_profile_id)
|
|
262
|
+
api_client.invoke_delete(
|
|
263
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES, control_profile_id),
|
|
264
|
+
sdk_authorization
|
|
265
|
+
)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# @param [String] control_profile_id
|
|
269
|
+
# @param [String] target_id
|
|
270
|
+
def add_target_to_control_profile(control_profile_id, target_id)
|
|
271
|
+
api_client.invoke_post(
|
|
272
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES, control_profile_id, ADD, target_id),
|
|
273
|
+
sdk_authorization
|
|
274
|
+
)
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# @param [String] control_profile_id
|
|
278
|
+
# @param [String] target_id
|
|
279
|
+
def remove_target_from_control_profile(control_profile_id, target_id)
|
|
280
|
+
api_client.invoke_post(
|
|
281
|
+
build_path(ISSUING, CONTROLS, CONTROL_PROFILES, control_profile_id, REMOVE, target_id),
|
|
282
|
+
sdk_authorization
|
|
283
|
+
)
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# ====== Issuing Disputes ======
|
|
287
|
+
|
|
288
|
+
# @param [Hash, CreateDisputeRequest] create_dispute_request
|
|
289
|
+
def create_issuing_dispute(create_dispute_request)
|
|
290
|
+
api_client.invoke_post(
|
|
291
|
+
build_path(ISSUING, DISPUTES),
|
|
292
|
+
sdk_authorization,
|
|
293
|
+
create_dispute_request
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# @param [String] dispute_id
|
|
298
|
+
def get_issuing_dispute(dispute_id)
|
|
299
|
+
api_client.invoke_get(build_path(ISSUING, DISPUTES, dispute_id), sdk_authorization)
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# @param [String] dispute_id
|
|
303
|
+
def cancel_issuing_dispute(dispute_id)
|
|
304
|
+
api_client.invoke_post(
|
|
305
|
+
build_path(ISSUING, DISPUTES, dispute_id, CANCEL),
|
|
306
|
+
sdk_authorization
|
|
307
|
+
)
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# @param [String] dispute_id
|
|
311
|
+
# @param [Hash, EscalateDisputeRequest] escalate_dispute_request
|
|
312
|
+
def escalate_issuing_dispute(dispute_id, escalate_dispute_request)
|
|
313
|
+
api_client.invoke_post(
|
|
314
|
+
build_path(ISSUING, DISPUTES, dispute_id, ESCALATE),
|
|
315
|
+
sdk_authorization,
|
|
316
|
+
escalate_dispute_request
|
|
317
|
+
)
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# ====== Transactions ======
|
|
321
|
+
|
|
322
|
+
# @param [Hash] transactions_query
|
|
323
|
+
def get_transactions(transactions_query = nil)
|
|
324
|
+
api_client.invoke_get(
|
|
325
|
+
build_path(ISSUING, TRANSACTIONS),
|
|
326
|
+
sdk_authorization,
|
|
327
|
+
transactions_query
|
|
328
|
+
)
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# @param [String] transaction_id
|
|
332
|
+
def get_transaction(transaction_id)
|
|
333
|
+
api_client.invoke_get(
|
|
334
|
+
build_path(ISSUING, TRANSACTIONS, transaction_id),
|
|
335
|
+
sdk_authorization
|
|
336
|
+
)
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# ====== Digital Cards ======
|
|
340
|
+
|
|
341
|
+
# @param [String] digital_card_id
|
|
342
|
+
def get_digital_card(digital_card_id)
|
|
343
|
+
api_client.invoke_get(
|
|
344
|
+
build_path(ISSUING, DIGITAL_CARDS, digital_card_id),
|
|
345
|
+
sdk_authorization
|
|
346
|
+
)
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# ====== Simulations ======
|
|
350
|
+
|
|
130
351
|
# @param [Hash] authorization_request
|
|
131
352
|
def simulate_authorization(authorization_request)
|
|
132
353
|
api_client.invoke_post(build_path(ISSUING, SIMULATE, AUTHORIZATIONS), sdk_authorization, authorization_request)
|
|
@@ -161,6 +382,38 @@ module CheckoutSdk
|
|
|
161
382
|
reversal_request
|
|
162
383
|
)
|
|
163
384
|
end
|
|
385
|
+
|
|
386
|
+
# Simulate a refund for an authorization.
|
|
387
|
+
# @param [String] transaction_id
|
|
388
|
+
# @param [Hash, SimulateRefundRequest] refund_request
|
|
389
|
+
def simulate_refund(transaction_id, refund_request)
|
|
390
|
+
api_client.invoke_post(
|
|
391
|
+
build_path(ISSUING, SIMULATE, AUTHORIZATIONS, transaction_id, REFUNDS),
|
|
392
|
+
sdk_authorization,
|
|
393
|
+
refund_request
|
|
394
|
+
)
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# Request a Cardholder access token.
|
|
398
|
+
# The api_client serializes the body as application/x-www-form-urlencoded.
|
|
399
|
+
# @param [Hash, CardholderAccessTokenRequest] cardholder_token_request
|
|
400
|
+
def request_cardholder_access_token(cardholder_token_request)
|
|
401
|
+
api_client.invoke_post(
|
|
402
|
+
build_path(ISSUING, ACCESS, CONNECT, TOKEN),
|
|
403
|
+
sdk_authorization(CheckoutSdk::AuthorizationType::OAUTH),
|
|
404
|
+
cardholder_token_request
|
|
405
|
+
)
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Simulate an out-of-band (OOB) authentication request.
|
|
409
|
+
# @param [Hash, OobAuthenticationRequest] oob_authentication_request
|
|
410
|
+
def simulate_oob_authentication(oob_authentication_request)
|
|
411
|
+
api_client.invoke_post(
|
|
412
|
+
build_path(ISSUING, SIMULATE, OOB, AUTHENTICATION),
|
|
413
|
+
sdk_authorization(CheckoutSdk::AuthorizationType::OAUTH),
|
|
414
|
+
oob_authentication_request
|
|
415
|
+
)
|
|
416
|
+
end
|
|
164
417
|
end
|
|
165
418
|
end
|
|
166
419
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Phone number block used in Issuing requests (e.g. cardholder updates).
|
|
6
|
+
# Matches swagger `IssuingPhoneNumber`.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute country_code
|
|
9
|
+
# @return [String] E.164 country dial code (e.g. "+1").
|
|
10
|
+
# @!attribute number
|
|
11
|
+
# @return [String] Local subscriber number.
|
|
12
|
+
class IssuingPhoneNumber
|
|
13
|
+
attr_accessor :country_code, :number
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for POST /issuing/simulate/oob/authentication.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute card_id
|
|
8
|
+
# @return [String] The card's unique identifier (e.g. "crd_...").
|
|
9
|
+
# @!attribute transaction_details
|
|
10
|
+
# @return [OobSimulateTransactionDetails]
|
|
11
|
+
class OobAuthenticationRequest
|
|
12
|
+
attr_accessor :card_id, :transaction_details
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Details for a simulated OOB authentication transaction.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute last_four
|
|
8
|
+
# @return [String] The last four digits of the card.
|
|
9
|
+
# @!attribute merchant_name
|
|
10
|
+
# @return [String]
|
|
11
|
+
# @!attribute purchase_amount
|
|
12
|
+
# @return [Numeric]
|
|
13
|
+
# @!attribute purchase_currency
|
|
14
|
+
# @return [String] ISO currency (e.g. "GBP").
|
|
15
|
+
class OobSimulateTransactionDetails
|
|
16
|
+
attr_accessor :last_four, :merchant_name, :purchase_amount, :purchase_currency
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for POST /issuing/cards/{cardId}/schedule-revocation.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute revocation_date
|
|
8
|
+
# @return [String] ISO-8601 date the card revocation should take effect.
|
|
9
|
+
class ScheduleRevocationRequest
|
|
10
|
+
attr_accessor :revocation_date
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for POST /issuing/simulate/authorizations/{id}/refunds.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute amount
|
|
8
|
+
# @return [Integer]
|
|
9
|
+
class SimulateRefundRequest
|
|
10
|
+
attr_accessor :amount
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for PATCH /issuing/cards/{cardId}.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute reference
|
|
8
|
+
# @return [String]
|
|
9
|
+
# @!attribute metadata
|
|
10
|
+
# @return [Hash{String => String}]
|
|
11
|
+
# @!attribute expiry_month
|
|
12
|
+
# @return [Integer]
|
|
13
|
+
# @!attribute expiry_year
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
class UpdateCardRequest
|
|
16
|
+
attr_accessor :reference, :metadata, :expiry_month, :expiry_year
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for PATCH /issuing/cardholders/{cardholderId}.
|
|
6
|
+
# Maps swagger `update-cardholder-request`.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute first_name
|
|
9
|
+
# @return [String]
|
|
10
|
+
# @!attribute middle_name
|
|
11
|
+
# @return [String]
|
|
12
|
+
# @!attribute last_name
|
|
13
|
+
# @return [String]
|
|
14
|
+
# @!attribute date_of_birth
|
|
15
|
+
# @return [String] ISO-8601 date.
|
|
16
|
+
# @!attribute phone_number
|
|
17
|
+
# @return [IssuingPhoneNumber]
|
|
18
|
+
# @!attribute email
|
|
19
|
+
# @return [String] Email address (rfc6530). Max 254 characters.
|
|
20
|
+
# @!attribute billing_address
|
|
21
|
+
# @return [IssuingAddress]
|
|
22
|
+
# @!attribute residency_address
|
|
23
|
+
# @return [IssuingAddress]
|
|
24
|
+
# @!attribute document
|
|
25
|
+
# @return [IdentificationDocument]
|
|
26
|
+
class UpdateCardholderRequest
|
|
27
|
+
attr_accessor :first_name, :middle_name, :last_name, :date_of_birth,
|
|
28
|
+
:phone_number, :email, :billing_address, :residency_address,
|
|
29
|
+
:document
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Issuing
|
|
5
|
+
# Request body for PATCH /issuing/controls/control-profiles/{controlProfileId}.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute name
|
|
8
|
+
# @return [String]
|
|
9
|
+
class UpdateControlProfileRequest
|
|
10
|
+
attr_accessor :name
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module NetworkTokens
|
|
5
|
+
# Request body for POST /network-tokens/{network_token_id}/cryptograms.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute transaction_type
|
|
8
|
+
# @return [String] One of "ecom", "recurring", "pos", "aft".
|
|
9
|
+
class NetworkTokenCryptogramRequest
|
|
10
|
+
attr_accessor :transaction_type
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module NetworkTokens
|
|
5
|
+
# Card-based source for provisioning a network token. Set `type = "card"`.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute type
|
|
8
|
+
# @return [String] Always "card".
|
|
9
|
+
# @!attribute number
|
|
10
|
+
# @return [String] The card number.
|
|
11
|
+
# @!attribute cvv
|
|
12
|
+
# @return [String]
|
|
13
|
+
# @!attribute expiry_month
|
|
14
|
+
# @return [String] 1- or 2-digit month.
|
|
15
|
+
# @!attribute expiry_year
|
|
16
|
+
# @return [String] Four-digit year.
|
|
17
|
+
class NetworkTokenSourceCard
|
|
18
|
+
attr_accessor :type, :number, :cvv, :expiry_month, :expiry_year
|
|
19
|
+
|
|
20
|
+
def initialize
|
|
21
|
+
@type = 'card'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module NetworkTokens
|
|
5
|
+
# Existing-instrument source for provisioning a network token. Set `type = "id"`.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute type
|
|
8
|
+
# @return [String] Always "id".
|
|
9
|
+
# @!attribute id
|
|
10
|
+
# @return [String] The source instrument id (e.g. "src_...").
|
|
11
|
+
class NetworkTokenSourceId
|
|
12
|
+
attr_accessor :type, :id
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
@type = 'id'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'checkout_sdk/network_tokens/network_token_source_card'
|
|
4
|
+
require 'checkout_sdk/network_tokens/network_token_source_id'
|
|
5
|
+
require 'checkout_sdk/network_tokens/provision_network_token_request'
|
|
6
|
+
require 'checkout_sdk/network_tokens/network_token_cryptogram_request'
|
|
7
|
+
require 'checkout_sdk/network_tokens/network_tokens_client'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module NetworkTokens
|
|
5
|
+
# Client for the Network Tokens API.
|
|
6
|
+
class NetworkTokensClient < Client
|
|
7
|
+
NETWORK_TOKENS = 'network-tokens'
|
|
8
|
+
CRYPTOGRAMS = 'cryptograms'
|
|
9
|
+
DELETE = 'delete'
|
|
10
|
+
private_constant :NETWORK_TOKENS, :CRYPTOGRAMS, :DELETE
|
|
11
|
+
|
|
12
|
+
# @param [ApiClient] api_client
|
|
13
|
+
# @param [CheckoutConfiguration] configuration
|
|
14
|
+
def initialize(api_client, configuration)
|
|
15
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Provision a Network Token.
|
|
19
|
+
# @param [Hash, ProvisionNetworkTokenRequest] provision_request
|
|
20
|
+
def provision_network_token(provision_request)
|
|
21
|
+
api_client.invoke_post(NETWORK_TOKENS, sdk_authorization, provision_request)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Retrieve a Network Token.
|
|
25
|
+
# @param [String] network_token_id
|
|
26
|
+
def get_network_token(network_token_id)
|
|
27
|
+
api_client.invoke_get(build_path(NETWORK_TOKENS, network_token_id), sdk_authorization)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Request a fresh cryptogram for a Network Token (for SCA / fresh payment flows).
|
|
31
|
+
# @param [String] network_token_id
|
|
32
|
+
# @param [Hash, NetworkTokenCryptogramRequest] cryptogram_request
|
|
33
|
+
def request_cryptograms(network_token_id, cryptogram_request = nil)
|
|
34
|
+
api_client.invoke_post(
|
|
35
|
+
build_path(NETWORK_TOKENS, network_token_id, CRYPTOGRAMS),
|
|
36
|
+
sdk_authorization,
|
|
37
|
+
cryptogram_request
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Soft-delete a Network Token. The API uses PATCH on .../delete.
|
|
42
|
+
# @param [String] network_token_id
|
|
43
|
+
def delete_network_token(network_token_id)
|
|
44
|
+
api_client.invoke_patch(
|
|
45
|
+
build_path(NETWORK_TOKENS, network_token_id, DELETE),
|
|
46
|
+
sdk_authorization
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module NetworkTokens
|
|
5
|
+
# Request body for POST /network-tokens.
|
|
6
|
+
# `source` must be either a NetworkTokenSourceCard or a NetworkTokenSourceId.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute source
|
|
9
|
+
# @return [NetworkTokenSourceCard, NetworkTokenSourceId]
|
|
10
|
+
class ProvisionNetworkTokenRequest
|
|
11
|
+
attr_accessor :source
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'checkout_sdk/onboarding_simulator/simulator_entity_status'
|
|
4
|
+
require 'checkout_sdk/onboarding_simulator/simulator_set_requirements_due_request'
|
|
5
|
+
require 'checkout_sdk/onboarding_simulator/simulator_set_status_request'
|
|
6
|
+
require 'checkout_sdk/onboarding_simulator/onboarding_simulator_client'
|