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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6c3aef40d718427d47878b6c6174bfcb1a2f4274c51db158efebfc1fdecd993
|
|
4
|
+
data.tar.gz: 269022fe826ad896f0125dc3ea9e23ebb8281c69dfc6063c5aa2acf73ba83f0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67261cc04bc54a206a83a37f30fc82bb9bdda222042ba3eee48427c6fa32c485949405b89322ac47153d47391496ddfb5368cc02df6107f375657829fe573737
|
|
7
|
+
data.tar.gz: 35a1f59b1ff5de20afdb8b63957ed8fddd172dacdead62cd996129b3171f1eeeb12f44cb5dea1e59db3056cf70e7e7a8d216af88fa7d6f1124c3b4887c8487e0
|
data/.rubocop.yml
CHANGED
|
@@ -18,12 +18,21 @@ Metrics/ModuleLength:
|
|
|
18
18
|
|
|
19
19
|
Metrics/MethodLength:
|
|
20
20
|
Max: 25
|
|
21
|
+
Exclude:
|
|
22
|
+
# Aggregator that wires up every product client; grows with each new product.
|
|
23
|
+
- "**/checkout_api.rb"
|
|
21
24
|
|
|
22
25
|
Metrics/ParameterLists:
|
|
23
26
|
Max: 10
|
|
24
27
|
|
|
25
28
|
Metrics/ClassLength:
|
|
26
|
-
|
|
29
|
+
# Raised from 120: SDK classes (e.g. ApiClient, response DTOs) grow as new
|
|
30
|
+
# API conventions and fields are adopted upstream.
|
|
31
|
+
Max: 150
|
|
32
|
+
Exclude:
|
|
33
|
+
# Endpoint-collection clients: one method per REST endpoint, grow with the API.
|
|
34
|
+
- "**/issuing_client.rb"
|
|
35
|
+
- "**/accounts_client.rb"
|
|
27
36
|
|
|
28
37
|
Metrics/CyclomaticComplexity:
|
|
29
38
|
Max: 10
|
|
@@ -37,6 +46,11 @@ Style/Documentation:
|
|
|
37
46
|
Style/OpenStructUse:
|
|
38
47
|
Enabled: false
|
|
39
48
|
|
|
49
|
+
Naming/AccessorMethodName:
|
|
50
|
+
# The SDK consistently prefixes read endpoints with get_ to mirror the REST API
|
|
51
|
+
# (e.g. get_cardholder, get_card_details). Zero-arg variants would otherwise flag.
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
40
54
|
Naming/MethodName:
|
|
41
55
|
Exclude:
|
|
42
56
|
- "**/google_pay_token_data*"
|
|
@@ -36,7 +36,6 @@ require 'checkout_sdk/accounts/instrument_details_sepa'
|
|
|
36
36
|
require 'checkout_sdk/accounts/instrument_details_card_token'
|
|
37
37
|
require 'checkout_sdk/accounts/payment_instrument_request'
|
|
38
38
|
require 'checkout_sdk/accounts/payment_instruments_query'
|
|
39
|
-
require 'checkout_sdk/accounts/headers'
|
|
40
39
|
require 'checkout_sdk/accounts/update_payment_instrument_request'
|
|
41
40
|
require 'checkout_sdk/accounts/additional_document'
|
|
42
41
|
require 'checkout_sdk/accounts/additional_info'
|
|
@@ -59,3 +58,13 @@ require 'checkout_sdk/accounts/shareholder_structure'
|
|
|
59
58
|
require 'checkout_sdk/accounts/shareholder_structure_type'
|
|
60
59
|
require 'checkout_sdk/accounts/tax_verification'
|
|
61
60
|
require 'checkout_sdk/accounts/tax_verification_type'
|
|
61
|
+
require 'checkout_sdk/accounts/submitter'
|
|
62
|
+
require 'checkout_sdk/accounts/entity_requirement_reason'
|
|
63
|
+
require 'checkout_sdk/accounts/entity_requirement_priority'
|
|
64
|
+
require 'checkout_sdk/accounts/entity_requirement_update_status'
|
|
65
|
+
require 'checkout_sdk/accounts/entity_requirement_update_request'
|
|
66
|
+
require 'checkout_sdk/accounts/reserve_rule_holding_duration'
|
|
67
|
+
require 'checkout_sdk/accounts/rolling_reserve_rule'
|
|
68
|
+
require 'checkout_sdk/accounts/reserve_rule_update_request'
|
|
69
|
+
require 'checkout_sdk/accounts/reserve_rule_create_request'
|
|
70
|
+
require 'checkout_sdk/accounts/entity_files_request'
|
|
@@ -11,7 +11,11 @@ module CheckoutSdk
|
|
|
11
11
|
PAYOUT_SCHEDULE = 'payout-schedules'
|
|
12
12
|
FILES = 'files'
|
|
13
13
|
PAYMENT_INSTRUMENTS = 'payment-instruments'
|
|
14
|
-
|
|
14
|
+
REQUIREMENTS = 'requirements'
|
|
15
|
+
RESERVE_RULES = 'reserve-rules'
|
|
16
|
+
MEMBERS = 'members'
|
|
17
|
+
private_constant :ACCOUNTS, :ENTITIES, :INSTRUMENT, :PAYOUT_SCHEDULE, :FILES, :PAYMENT_INSTRUMENTS,
|
|
18
|
+
:REQUIREMENTS, :RESERVE_RULES, :MEMBERS
|
|
15
19
|
|
|
16
20
|
# @param [ApiClient] api_client
|
|
17
21
|
# @param [ApiClient] files_client
|
|
@@ -93,6 +97,135 @@ module CheckoutSdk
|
|
|
93
97
|
def upload_file(file_request)
|
|
94
98
|
files_client.submit_file(FILES, sdk_authorization, file_request)
|
|
95
99
|
end
|
|
100
|
+
|
|
101
|
+
# Retrieve the list of pending requirements that a sub-entity must resolve.
|
|
102
|
+
# @param [String] entity_id
|
|
103
|
+
def get_entity_requirements(entity_id)
|
|
104
|
+
api_client.invoke_get(
|
|
105
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, REQUIREMENTS),
|
|
106
|
+
sdk_authorization
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Retrieve detailed information for a single requirement.
|
|
111
|
+
# @param [String] entity_id
|
|
112
|
+
# @param [String] requirement_id
|
|
113
|
+
def get_entity_requirement_details(entity_id, requirement_id)
|
|
114
|
+
api_client.invoke_get(
|
|
115
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, REQUIREMENTS, requirement_id),
|
|
116
|
+
sdk_authorization
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Submit a response to resolve a requirement.
|
|
121
|
+
# @param [String] entity_id
|
|
122
|
+
# @param [String] requirement_id
|
|
123
|
+
# @param [Hash, EntityRequirementUpdateRequest] update_request
|
|
124
|
+
def resolve_entity_requirement(entity_id, requirement_id, update_request)
|
|
125
|
+
api_client.invoke_put(
|
|
126
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, REQUIREMENTS, requirement_id),
|
|
127
|
+
sdk_authorization,
|
|
128
|
+
update_request
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Add a reserve rule for a sub-entity.
|
|
133
|
+
# @param [String] entity_id
|
|
134
|
+
# @param [Hash, ReserveRuleCreateRequest] reserve_rule_request
|
|
135
|
+
def add_reserve_rule(entity_id, reserve_rule_request)
|
|
136
|
+
api_client.invoke_post(
|
|
137
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, RESERVE_RULES),
|
|
138
|
+
sdk_authorization,
|
|
139
|
+
reserve_rule_request
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Query reserve rules for a sub-entity.
|
|
144
|
+
# @param [String] entity_id
|
|
145
|
+
def query_reserve_rules(entity_id)
|
|
146
|
+
api_client.invoke_get(
|
|
147
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, RESERVE_RULES),
|
|
148
|
+
sdk_authorization
|
|
149
|
+
)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Retrieve a reserve rule by id.
|
|
153
|
+
# @param [String] entity_id
|
|
154
|
+
# @param [String] reserve_rule_id
|
|
155
|
+
def get_reserve_rule(entity_id, reserve_rule_id)
|
|
156
|
+
api_client.invoke_get(
|
|
157
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, RESERVE_RULES, reserve_rule_id),
|
|
158
|
+
sdk_authorization
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Update a reserve rule.
|
|
163
|
+
# The API enforces optimistic concurrency: the ETag returned by GET must be
|
|
164
|
+
# echoed back via {CheckoutSdk::Common::Headers#if_match}, otherwise the
|
|
165
|
+
# API responds 428 Precondition Required.
|
|
166
|
+
# @param [String] entity_id
|
|
167
|
+
# @param [String] reserve_rule_id
|
|
168
|
+
# @param [String] etag ETag value to forward as the `If-Match` HTTP header.
|
|
169
|
+
# @param [Hash, ReserveRuleUpdateRequest] reserve_rule_request
|
|
170
|
+
def update_reserve_rule(entity_id, reserve_rule_id, etag, reserve_rule_request)
|
|
171
|
+
headers = nil
|
|
172
|
+
if !etag.nil? && !etag.empty?
|
|
173
|
+
headers = CheckoutSdk::Common::Headers.new
|
|
174
|
+
headers.if_match = etag
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
api_client.invoke_put(
|
|
178
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, RESERVE_RULES, reserve_rule_id),
|
|
179
|
+
sdk_authorization,
|
|
180
|
+
reserve_rule_request,
|
|
181
|
+
headers
|
|
182
|
+
)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# List sub-entity members.
|
|
186
|
+
# @param [String] entity_id
|
|
187
|
+
def get_sub_entity_members(entity_id)
|
|
188
|
+
api_client.invoke_get(
|
|
189
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, MEMBERS),
|
|
190
|
+
sdk_authorization
|
|
191
|
+
)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Reinvite a sub-entity member.
|
|
195
|
+
# The API marks the request body as required; callers must provide a Hash
|
|
196
|
+
# (or `PlatformsHostedOnboardReinviteRequest`-shaped object), even if it
|
|
197
|
+
# is empty `{}` per the current swagger contract.
|
|
198
|
+
# @param [String] entity_id
|
|
199
|
+
# @param [String] user_id
|
|
200
|
+
# @param [Hash] reinvite_request Required body per swagger; pass `{}` if no fields are needed.
|
|
201
|
+
def reinvite_sub_entity_member(entity_id, user_id, reinvite_request)
|
|
202
|
+
api_client.invoke_put(
|
|
203
|
+
build_path(ACCOUNTS, ENTITIES, entity_id, MEMBERS, user_id),
|
|
204
|
+
sdk_authorization,
|
|
205
|
+
reinvite_request
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Upload a file scoped to a sub-entity. Hits POST /entities/{entityId}/files.
|
|
210
|
+
# @param [String] entity_id
|
|
211
|
+
# @param [Hash, EntityFilesRequest] file_request
|
|
212
|
+
def upload_entity_file(entity_id, file_request)
|
|
213
|
+
files_client.submit_file(
|
|
214
|
+
build_path(ENTITIES, entity_id, FILES),
|
|
215
|
+
sdk_authorization,
|
|
216
|
+
file_request
|
|
217
|
+
)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Retrieve a file scoped to a sub-entity. Hits GET /entities/{entityId}/files/{fileId}.
|
|
221
|
+
# @param [String] entity_id
|
|
222
|
+
# @param [String] file_id
|
|
223
|
+
def get_entity_file(entity_id, file_id)
|
|
224
|
+
files_client.invoke_get(
|
|
225
|
+
build_path(ENTITIES, entity_id, FILES, file_id),
|
|
226
|
+
sdk_authorization
|
|
227
|
+
)
|
|
228
|
+
end
|
|
96
229
|
end
|
|
97
230
|
end
|
|
98
231
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Request body for POST /entities/{entityId}/files.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute purpose
|
|
8
|
+
# @return [String] Purpose of the file (e.g. "bank_verification").
|
|
9
|
+
class EntityFilesRequest
|
|
10
|
+
attr_accessor :purpose
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Priority of a sub-entity requirement. "critical" if the deadline is within 7 days,
|
|
6
|
+
# otherwise "high" by default.
|
|
7
|
+
module EntityRequirementPriority
|
|
8
|
+
HIGH = 'high'
|
|
9
|
+
CRITICAL = 'critical'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Request body for PUT /accounts/entities/{id}/requirements/{requirementId}.
|
|
6
|
+
#
|
|
7
|
+
# The expected shape of `value` is defined by the JSON Schema returned in
|
|
8
|
+
# the requirement details response. Common shapes include a file reference
|
|
9
|
+
# (e.g. { "file_id": "file_..." }), a primitive value, or a structured object.
|
|
10
|
+
#
|
|
11
|
+
# @!attribute value
|
|
12
|
+
# The response to the requirement. Polymorphic per swagger
|
|
13
|
+
# (`oneOf [object, array, string, number, boolean]`), so the only valid
|
|
14
|
+
# Ruby annotation is `Object`. The concrete shape is dictated at runtime
|
|
15
|
+
# by the requirement's `_schema` returned from
|
|
16
|
+
# `GET /accounts/entities/{id}/requirements/{requirementId}`.
|
|
17
|
+
# @return [Object]
|
|
18
|
+
class EntityRequirementUpdateRequest
|
|
19
|
+
attr_accessor :value
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Status returned after submitting a requirement response.
|
|
6
|
+
# While processing, the requirement is no longer retrievable via GET endpoints;
|
|
7
|
+
# if validation fails downstream the requirement may reappear.
|
|
8
|
+
module EntityRequirementUpdateStatus
|
|
9
|
+
PROCESSING = 'processing'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -20,6 +20,12 @@ module CheckoutSdk
|
|
|
20
20
|
# @return [OnboardSubEntityDocuments]
|
|
21
21
|
# @!attribute additional_info
|
|
22
22
|
# @return [AdditionalInfo]
|
|
23
|
+
# @!attribute seller_category
|
|
24
|
+
# @return [String] Identifier of a seller category configured on the platform
|
|
25
|
+
# during onboarding. Used for US ISV onboarding variants.
|
|
26
|
+
# @!attribute submitter
|
|
27
|
+
# @return [Submitter] Captures evidence of the end-user's consent to onboarding.
|
|
28
|
+
# Used for US ISV onboarding variants.
|
|
23
29
|
class OnboardEntity
|
|
24
30
|
attr_accessor :reference,
|
|
25
31
|
:is_draft,
|
|
@@ -29,7 +35,9 @@ module CheckoutSdk
|
|
|
29
35
|
:processing_details,
|
|
30
36
|
:individual,
|
|
31
37
|
:documents,
|
|
32
|
-
:additional_info
|
|
38
|
+
:additional_info,
|
|
39
|
+
:seller_category,
|
|
40
|
+
:submitter
|
|
33
41
|
end
|
|
34
42
|
end
|
|
35
43
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Request body for POST /accounts/entities/{id}/reserve-rules.
|
|
6
|
+
# Extends {ReserveRuleUpdateRequest} with `valid_from`.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute valid_from
|
|
9
|
+
# @return [String] ISO-8601 timestamp; must be at least 15 minutes in the future.
|
|
10
|
+
class ReserveRuleCreateRequest < ReserveRuleUpdateRequest
|
|
11
|
+
attr_accessor :valid_from
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# The length of time a rolling reserve collateral balance is held for.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute weeks
|
|
8
|
+
# @return [Integer] Min 2, max 104.
|
|
9
|
+
class ReserveRuleHoldingDuration
|
|
10
|
+
attr_accessor :weeks
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Request body for PUT /accounts/entities/{entityId}/reserve-rules/{id}.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute type
|
|
8
|
+
# @return [String] Reserve rule type (e.g. "rolling").
|
|
9
|
+
# @!attribute rolling
|
|
10
|
+
# @return [RollingReserveRule]
|
|
11
|
+
class ReserveRuleUpdateRequest
|
|
12
|
+
attr_accessor :type, :rolling
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Rolling reserve rule parameters.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute percentage
|
|
8
|
+
# @return [Float] Min 0, max 100.
|
|
9
|
+
# @!attribute holding_duration
|
|
10
|
+
# @return [ReserveRuleHoldingDuration]
|
|
11
|
+
class RollingReserveRule
|
|
12
|
+
attr_accessor :percentage, :holding_duration
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# Captures evidence of the end-user's consent to onboarding.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute ip_address
|
|
8
|
+
# @return [String] IP address of the end-user submitting the onboarding request.
|
|
9
|
+
class Submitter
|
|
10
|
+
attr_accessor :ip_address
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'checkout_sdk/agentic_commerce/delegated_payment_method_card'
|
|
4
|
+
require 'checkout_sdk/agentic_commerce/delegated_payment_allowance'
|
|
5
|
+
require 'checkout_sdk/agentic_commerce/delegated_payment_billing_address'
|
|
6
|
+
require 'checkout_sdk/agentic_commerce/delegated_payment_risk_signal'
|
|
7
|
+
require 'checkout_sdk/agentic_commerce/delegated_payment_request'
|
|
8
|
+
require 'checkout_sdk/agentic_commerce/agentic_commerce_client'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Client for the Agentic Commerce Protocol API (Beta).
|
|
6
|
+
# Used by AI agents to create delegated payment tokens scoped to a single purchase.
|
|
7
|
+
class AgenticCommerceClient < Client
|
|
8
|
+
AGENTIC_COMMERCE = 'agentic_commerce'
|
|
9
|
+
DELEGATE_PAYMENT = 'delegate_payment'
|
|
10
|
+
private_constant :AGENTIC_COMMERCE, :DELEGATE_PAYMENT
|
|
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)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Create a delegated payment token.
|
|
19
|
+
# @param [Hash, DelegatedPaymentRequest] delegated_payment_request
|
|
20
|
+
# @param [String] idempotency_key Optional
|
|
21
|
+
def create_delegated_payment_token(delegated_payment_request, idempotency_key = nil)
|
|
22
|
+
api_client.invoke_post(
|
|
23
|
+
build_path(AGENTIC_COMMERCE, DELEGATE_PAYMENT),
|
|
24
|
+
sdk_authorization,
|
|
25
|
+
delegated_payment_request,
|
|
26
|
+
idempotency_key
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Spend-limit allowance attached to a delegated payment.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute reason
|
|
8
|
+
# @return [String] e.g. "purchase".
|
|
9
|
+
# @!attribute max_amount
|
|
10
|
+
# @return [Integer] Maximum amount in the minor currency unit.
|
|
11
|
+
# @!attribute currency
|
|
12
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
|
13
|
+
# @!attribute checkout_session_id
|
|
14
|
+
# @return [String]
|
|
15
|
+
# @!attribute merchant_id
|
|
16
|
+
# @return [String]
|
|
17
|
+
# @!attribute expires_at
|
|
18
|
+
# @return [String] RFC 3339 timestamp.
|
|
19
|
+
class DelegatedPaymentAllowance
|
|
20
|
+
attr_accessor :reason,
|
|
21
|
+
:max_amount,
|
|
22
|
+
:currency,
|
|
23
|
+
:checkout_session_id,
|
|
24
|
+
:merchant_id,
|
|
25
|
+
:expires_at
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Billing address required for delegated payments. Mirrors swagger
|
|
6
|
+
# `DelegatedPaymentBillingAddress`. Required: `name`, `line_one`, `city`,
|
|
7
|
+
# `postal_code`, `country`.
|
|
8
|
+
#
|
|
9
|
+
# @!attribute name
|
|
10
|
+
# @return [String] Full customer name. [Required]
|
|
11
|
+
# @!attribute line_one
|
|
12
|
+
# @return [String] First line of the street address. [Required]
|
|
13
|
+
# @!attribute line_two
|
|
14
|
+
# @return [String] Second line of the street address.
|
|
15
|
+
# @!attribute city
|
|
16
|
+
# @return [String] [Required]
|
|
17
|
+
# @!attribute state
|
|
18
|
+
# @return [String] State / region.
|
|
19
|
+
# @!attribute postal_code
|
|
20
|
+
# @return [String] Postal/ZIP code. [Required]
|
|
21
|
+
# @!attribute country
|
|
22
|
+
# @return [String] ISO 3166-1 alpha-2. [Required]
|
|
23
|
+
class DelegatedPaymentBillingAddress
|
|
24
|
+
attr_accessor :name,
|
|
25
|
+
:line_one,
|
|
26
|
+
:line_two,
|
|
27
|
+
:city,
|
|
28
|
+
:state,
|
|
29
|
+
:postal_code,
|
|
30
|
+
:country
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Card payment-method block used inside a {DelegatedPaymentRequest}.
|
|
6
|
+
# Mirrors swagger `DelegatedPaymentMethodCard`. Required fields per spec:
|
|
7
|
+
# `type`, `card_number_type`, `number`, `metadata`.
|
|
8
|
+
#
|
|
9
|
+
# @!attribute type
|
|
10
|
+
# @return [String] Always "card".
|
|
11
|
+
# @!attribute card_number_type
|
|
12
|
+
# @return [String] Either "fpan" or "network_token".
|
|
13
|
+
# @!attribute number
|
|
14
|
+
# @return [String] The full card number.
|
|
15
|
+
# @!attribute exp_month
|
|
16
|
+
# @return [String] Two-digit expiry month (MM).
|
|
17
|
+
# @!attribute exp_year
|
|
18
|
+
# @return [String] Four-digit expiry year (YYYY).
|
|
19
|
+
# @!attribute name
|
|
20
|
+
# @return [String] Cardholder name.
|
|
21
|
+
# @!attribute cvc
|
|
22
|
+
# @return [String] Card verification code.
|
|
23
|
+
# @!attribute cryptogram
|
|
24
|
+
# @return [String] Cryptogram for network-token transactions.
|
|
25
|
+
# @!attribute eci_value
|
|
26
|
+
# @return [String] ECI / Security Level Indicator value.
|
|
27
|
+
# @!attribute checks_performed
|
|
28
|
+
# @return [Array<String>] Verification checks performed on the card.
|
|
29
|
+
# @!attribute iin
|
|
30
|
+
# @return [String] Issuer Identification Number (BIN).
|
|
31
|
+
# @!attribute display_card_funding_type
|
|
32
|
+
# @return [String] "credit", "debit", or "prepaid".
|
|
33
|
+
# @!attribute display_wallet_type
|
|
34
|
+
# @return [String] Wallet type for display.
|
|
35
|
+
# @!attribute display_brand
|
|
36
|
+
# @return [String] Card brand for display (e.g. "Visa").
|
|
37
|
+
# @!attribute display_last4
|
|
38
|
+
# @return [String] Last four digits for display.
|
|
39
|
+
# @!attribute metadata
|
|
40
|
+
# @return [Hash{String => String}] Key-value pairs; required per swagger.
|
|
41
|
+
class DelegatedPaymentMethodCard
|
|
42
|
+
attr_accessor :type,
|
|
43
|
+
:card_number_type,
|
|
44
|
+
:number,
|
|
45
|
+
:exp_month,
|
|
46
|
+
:exp_year,
|
|
47
|
+
:name,
|
|
48
|
+
:cvc,
|
|
49
|
+
:cryptogram,
|
|
50
|
+
:eci_value,
|
|
51
|
+
:checks_performed,
|
|
52
|
+
:iin,
|
|
53
|
+
:display_card_funding_type,
|
|
54
|
+
:display_wallet_type,
|
|
55
|
+
:display_brand,
|
|
56
|
+
:display_last4,
|
|
57
|
+
:metadata
|
|
58
|
+
|
|
59
|
+
def initialize
|
|
60
|
+
@type = 'card'
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Request body for POST /agentic_commerce/delegate_payment.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute payment_method
|
|
8
|
+
# @return [DelegatedPaymentMethodCard]
|
|
9
|
+
# @!attribute allowance
|
|
10
|
+
# @return [DelegatedPaymentAllowance]
|
|
11
|
+
# @!attribute billing_address
|
|
12
|
+
# @return [DelegatedPaymentBillingAddress]
|
|
13
|
+
# @!attribute risk_signals
|
|
14
|
+
# @return [Array<DelegatedPaymentRiskSignal>]
|
|
15
|
+
# @!attribute metadata
|
|
16
|
+
# @return [Hash{String => String}] Free-form key/value metadata.
|
|
17
|
+
class DelegatedPaymentRequest
|
|
18
|
+
attr_accessor :payment_method,
|
|
19
|
+
:allowance,
|
|
20
|
+
:billing_address,
|
|
21
|
+
:risk_signals,
|
|
22
|
+
:metadata
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module AgenticCommerce
|
|
5
|
+
# Risk signal attached to a delegated payment request. Mirrors swagger
|
|
6
|
+
# `DelegatedPaymentRiskSignal`. All three fields are required per spec.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute type
|
|
9
|
+
# @return [String] Risk signal type. [Required]
|
|
10
|
+
# @!attribute score
|
|
11
|
+
# @return [Integer] Risk score. [Required]
|
|
12
|
+
# @!attribute action
|
|
13
|
+
# @return [String] Action taken based on the risk assessment. [Required]
|
|
14
|
+
class DelegatedPaymentRiskSignal
|
|
15
|
+
attr_accessor :type,
|
|
16
|
+
:score,
|
|
17
|
+
:action
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|