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
|
@@ -22,8 +22,8 @@ module CheckoutSdk
|
|
|
22
22
|
invoke(:post, path, authorization, request, idempotency_key, params: nil)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def invoke_put(path, authorization, request)
|
|
26
|
-
invoke(:put, path, authorization, request, nil, params: nil)
|
|
25
|
+
def invoke_put(path, authorization, request, headers = nil)
|
|
26
|
+
invoke(:put, path, authorization, request, nil, params: nil, extra_headers: headers)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def invoke_patch(path, authorization, request = nil)
|
|
@@ -40,13 +40,15 @@ module CheckoutSdk
|
|
|
40
40
|
|
|
41
41
|
private
|
|
42
42
|
|
|
43
|
-
def invoke(method, path, authorization, body = nil, idempotency_key = nil, params: nil)
|
|
43
|
+
def invoke(method, path, authorization, body = nil, idempotency_key = nil, params: nil, extra_headers: nil)
|
|
44
44
|
path = append_params(path, params) unless params.nil?
|
|
45
45
|
|
|
46
46
|
headers = default_headers(authorization)
|
|
47
47
|
headers[:'Content-Type'] = 'application/json'
|
|
48
48
|
headers[:'Cko-Idempotency-Key'] = idempotency_key unless idempotency_key.nil?
|
|
49
49
|
|
|
50
|
+
apply_extra_headers(headers, extra_headers)
|
|
51
|
+
|
|
50
52
|
json_body = CheckoutSdk::JsonSerializer.to_custom_hash(body).to_json
|
|
51
53
|
|
|
52
54
|
begin
|
|
@@ -64,6 +66,16 @@ module CheckoutSdk
|
|
|
64
66
|
Authorization: authorization.authorization_header }
|
|
65
67
|
end
|
|
66
68
|
|
|
69
|
+
# Map a typed headers container (e.g. {CheckoutSdk::Common::Headers}) onto the underlying
|
|
70
|
+
# HTTP header hash. Each attribute that's set is emitted as the corresponding
|
|
71
|
+
# canonical HTTP header.
|
|
72
|
+
def apply_extra_headers(http_headers, extra_headers)
|
|
73
|
+
return if extra_headers.nil?
|
|
74
|
+
return unless extra_headers.respond_to?(:if_match) && extra_headers.if_match
|
|
75
|
+
|
|
76
|
+
http_headers[:'If-Match'] = extra_headers.if_match
|
|
77
|
+
end
|
|
78
|
+
|
|
67
79
|
def append_params(path, input_params)
|
|
68
80
|
raise CheckoutArgumentException, 'Query parameters were not provided' if input_params.nil?
|
|
69
81
|
|
|
@@ -92,24 +104,22 @@ module CheckoutSdk
|
|
|
92
104
|
def upload(path, authorization, file_request)
|
|
93
105
|
headers = default_headers(authorization)
|
|
94
106
|
|
|
95
|
-
|
|
107
|
+
File.open(file_request.file) do |file|
|
|
108
|
+
form = build_multipart_request(file_request, file)
|
|
96
109
|
|
|
97
|
-
|
|
110
|
+
begin
|
|
111
|
+
@log.info "post: /#{path}"
|
|
112
|
+
response = @multipart_client.run_request(:post, path, form, headers)
|
|
113
|
+
rescue Faraday::ClientError => e
|
|
114
|
+
raise CheckoutApiException, e.response
|
|
115
|
+
end
|
|
98
116
|
|
|
99
|
-
|
|
100
|
-
@log.info "post: /#{path}"
|
|
101
|
-
response = @multipart_client.run_request(:post, path, form, headers)
|
|
102
|
-
rescue Faraday::ClientError => e
|
|
103
|
-
raise CheckoutApiException, e.response
|
|
104
|
-
ensure
|
|
105
|
-
file.close
|
|
117
|
+
parse_response(response)
|
|
106
118
|
end
|
|
107
|
-
|
|
108
|
-
parse_response(response)
|
|
109
119
|
end
|
|
110
120
|
|
|
111
121
|
def parse_response(response)
|
|
112
|
-
raise CheckoutApiException, response if response.status < 200 || response.status >=
|
|
122
|
+
raise CheckoutApiException, response if response.status < 200 || response.status >= 400
|
|
113
123
|
|
|
114
124
|
metadata = CheckoutUtils.map_to_http_metadata(response)
|
|
115
125
|
body = parse_body(response)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# Balance values returned per currency account (swagger schema: Balance).
|
|
6
|
+
#
|
|
7
|
+
# @!attribute pending
|
|
8
|
+
# @return [Integer] Incoming funds that will be added to Available once cleared.
|
|
9
|
+
# @!attribute available
|
|
10
|
+
# @return [Integer] Funds available for processing.
|
|
11
|
+
# @!attribute payable
|
|
12
|
+
# @return [Integer] Funds reserved from Available for outgoing transactions not yet cleared.
|
|
13
|
+
# @!attribute collateral
|
|
14
|
+
# @return [Integer] Funds held to cover potential liabilities.
|
|
15
|
+
# @!attribute operational
|
|
16
|
+
# @return [Integer] Funds held for processing Payouts and Issuing payments when Available is insufficient.
|
|
17
|
+
# @!attribute collateral_breakdown
|
|
18
|
+
# @return [CollateralBreakdown]
|
|
19
|
+
class BalanceValues
|
|
20
|
+
attr_accessor :pending,
|
|
21
|
+
:available,
|
|
22
|
+
:payable,
|
|
23
|
+
:collateral,
|
|
24
|
+
:operational,
|
|
25
|
+
:collateral_breakdown
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'checkout_sdk/balances/balances_query'
|
|
4
|
+
require 'checkout_sdk/balances/collateral_breakdown'
|
|
5
|
+
require 'checkout_sdk/balances/balance_values'
|
|
6
|
+
require 'checkout_sdk/balances/currency_account_balance'
|
|
3
7
|
require 'checkout_sdk/balances/balances_client'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# Query parameters accepted by GET /balances/{id}.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute query
|
|
8
|
+
# @return [String] Search expression (e.g. "currency:EUR").
|
|
9
|
+
# @!attribute with_currency_account_id
|
|
10
|
+
# @return [TrueClass, FalseClass] When true, the response includes the
|
|
11
|
+
# `currency_account_id` on each {CurrencyAccountBalance}.
|
|
12
|
+
# Serialised as `withCurrencyAccountId`.
|
|
13
|
+
# @!attribute balances_at
|
|
14
|
+
# @return [String] A UTC datetime (RFC 3339) to retrieve historical
|
|
15
|
+
# balances at a specific point in time. Must be in the past.
|
|
16
|
+
# Serialised as `balancesAt`.
|
|
17
|
+
class BalancesQuery
|
|
18
|
+
attr_accessor :query,
|
|
19
|
+
:with_currency_account_id,
|
|
20
|
+
:balances_at
|
|
21
|
+
|
|
22
|
+
# Returns the params in the camelCase form expected by the API.
|
|
23
|
+
def to_h
|
|
24
|
+
{
|
|
25
|
+
query: query,
|
|
26
|
+
withCurrencyAccountId: with_currency_account_id,
|
|
27
|
+
balancesAt: balances_at
|
|
28
|
+
}.compact
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# Breakdown of the funds held in the `collateral` balance.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute fixed_reserve
|
|
8
|
+
# @return [Integer] (required) The portion of the `collateral` balance held as a fixed reserve.
|
|
9
|
+
# @!attribute rolling_reserve
|
|
10
|
+
# @return [Integer] (required) The portion of the `collateral` balance held as a rolling reserve.
|
|
11
|
+
class CollateralBreakdown
|
|
12
|
+
attr_accessor :fixed_reserve,
|
|
13
|
+
:rolling_reserve
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# A single currency account's balance details (swagger: CurrencyAccountBalance).
|
|
6
|
+
#
|
|
7
|
+
# @!attribute currency_account_id
|
|
8
|
+
# @return [String] The unique identifier of the currency account (sub-account).
|
|
9
|
+
# Returned only when the request is made with `withCurrencyAccountId=true`.
|
|
10
|
+
# @!attribute descriptor
|
|
11
|
+
# @return [String]
|
|
12
|
+
# @!attribute holding_currency
|
|
13
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
|
14
|
+
# @!attribute balances_as_of
|
|
15
|
+
# @return [String] UTC datetime (RFC 3339) reflecting when balance values were fetched.
|
|
16
|
+
# @!attribute balances
|
|
17
|
+
# @return [BalanceValues]
|
|
18
|
+
class CurrencyAccountBalance
|
|
19
|
+
attr_accessor :currency_account_id,
|
|
20
|
+
:descriptor,
|
|
21
|
+
:holding_currency,
|
|
22
|
+
:balances_as_of,
|
|
23
|
+
:balances
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -45,8 +45,36 @@ module CheckoutSdk
|
|
|
45
45
|
# @return [CheckoutSdk::Payments::PaymentSessionsClient]
|
|
46
46
|
# @!attribute payments_setups
|
|
47
47
|
# @return [CheckoutSdk::Payments::PaymentSetupsClient]
|
|
48
|
+
# @!attribute flow
|
|
49
|
+
# @return [CheckoutSdk::Payments::FlowClient]
|
|
48
50
|
# @!attribute forward
|
|
49
51
|
# @return [CheckoutSdk::Forward::ForwardClient]
|
|
52
|
+
# @!attribute onboarding_simulator
|
|
53
|
+
# @return [CheckoutSdk::OnboardingSimulator::OnboardingSimulatorClient]
|
|
54
|
+
# @!attribute agentic_commerce
|
|
55
|
+
# @return [CheckoutSdk::AgenticCommerce::AgenticCommerceClient]
|
|
56
|
+
# @!attribute compliance_requests
|
|
57
|
+
# @return [CheckoutSdk::ComplianceRequests::ComplianceRequestsClient]
|
|
58
|
+
# @!attribute standalone_account_updater
|
|
59
|
+
# @return [CheckoutSdk::StandaloneAccountUpdater::StandaloneAccountUpdaterClient]
|
|
60
|
+
# @!attribute network_tokens
|
|
61
|
+
# @return [CheckoutSdk::NetworkTokens::NetworkTokensClient]
|
|
62
|
+
# @!attribute payment_methods
|
|
63
|
+
# @return [CheckoutSdk::PaymentMethods::PaymentMethodsClient]
|
|
64
|
+
# @!attribute applicants
|
|
65
|
+
# @return [CheckoutSdk::Identities::Applicants::ApplicantsClient]
|
|
66
|
+
# @!attribute aml_screening
|
|
67
|
+
# @return [CheckoutSdk::Identities::AmlScreening::AmlScreeningClient]
|
|
68
|
+
# @!attribute id_document_verification
|
|
69
|
+
# @return [CheckoutSdk::Identities::IdDocumentVerification::IdDocumentVerificationClient]
|
|
70
|
+
# @!attribute identity_verification
|
|
71
|
+
# @return [CheckoutSdk::Identities::IdentityVerification::IdentityVerificationClient]
|
|
72
|
+
# @!attribute face_authentication
|
|
73
|
+
# @return [CheckoutSdk::Identities::FaceAuthentication::FaceAuthenticationClient]
|
|
74
|
+
# @!attribute apple_pay
|
|
75
|
+
# @return [CheckoutSdk::Payments::ApplePayClient]
|
|
76
|
+
# @!attribute google_pay
|
|
77
|
+
# @return [CheckoutSdk::Payments::GooglePayClient]
|
|
50
78
|
class CheckoutApi
|
|
51
79
|
attr_reader :customers,
|
|
52
80
|
:disputes,
|
|
@@ -56,6 +84,7 @@ module CheckoutSdk
|
|
|
56
84
|
:links,
|
|
57
85
|
:payments,
|
|
58
86
|
:payments_setups,
|
|
87
|
+
:flow,
|
|
59
88
|
:reports,
|
|
60
89
|
:sessions,
|
|
61
90
|
:tokens,
|
|
@@ -70,7 +99,20 @@ module CheckoutSdk
|
|
|
70
99
|
:issuing,
|
|
71
100
|
:contexts,
|
|
72
101
|
:payment_sessions,
|
|
73
|
-
:forward
|
|
102
|
+
:forward,
|
|
103
|
+
:onboarding_simulator,
|
|
104
|
+
:agentic_commerce,
|
|
105
|
+
:compliance_requests,
|
|
106
|
+
:standalone_account_updater,
|
|
107
|
+
:network_tokens,
|
|
108
|
+
:payment_methods,
|
|
109
|
+
:applicants,
|
|
110
|
+
:aml_screening,
|
|
111
|
+
:id_document_verification,
|
|
112
|
+
:identity_verification,
|
|
113
|
+
:face_authentication,
|
|
114
|
+
:apple_pay,
|
|
115
|
+
:google_pay
|
|
74
116
|
|
|
75
117
|
# @param [CheckoutConfiguration] configuration
|
|
76
118
|
def initialize(configuration)
|
|
@@ -97,7 +139,25 @@ module CheckoutSdk
|
|
|
97
139
|
@contexts = CheckoutSdk::Payments::PaymentContextsClient.new api_client, configuration
|
|
98
140
|
@payment_sessions = CheckoutSdk::Payments::PaymentSessionsClient.new api_client, configuration
|
|
99
141
|
@payments_setups = CheckoutSdk::Payments::PaymentSetupsClient.new api_client, configuration
|
|
142
|
+
@flow = CheckoutSdk::Payments::FlowClient.new api_client, configuration
|
|
100
143
|
@forward = CheckoutSdk::Forward::ForwardClient.new(api_client, configuration)
|
|
144
|
+
@onboarding_simulator = CheckoutSdk::OnboardingSimulator::OnboardingSimulatorClient.new(api_client, configuration)
|
|
145
|
+
@agentic_commerce = CheckoutSdk::AgenticCommerce::AgenticCommerceClient.new(api_client, configuration)
|
|
146
|
+
@compliance_requests = CheckoutSdk::ComplianceRequests::ComplianceRequestsClient.new(api_client, configuration)
|
|
147
|
+
@standalone_account_updater =
|
|
148
|
+
CheckoutSdk::StandaloneAccountUpdater::StandaloneAccountUpdaterClient.new(api_client, configuration)
|
|
149
|
+
@network_tokens = CheckoutSdk::NetworkTokens::NetworkTokensClient.new(api_client, configuration)
|
|
150
|
+
@payment_methods = CheckoutSdk::PaymentMethods::PaymentMethodsClient.new(api_client, configuration)
|
|
151
|
+
@applicants = CheckoutSdk::Identities::Applicants::ApplicantsClient.new(api_client, configuration)
|
|
152
|
+
@aml_screening = CheckoutSdk::Identities::AmlScreening::AmlScreeningClient.new(api_client, configuration)
|
|
153
|
+
@id_document_verification =
|
|
154
|
+
CheckoutSdk::Identities::IdDocumentVerification::IdDocumentVerificationClient.new(api_client, configuration)
|
|
155
|
+
@identity_verification =
|
|
156
|
+
CheckoutSdk::Identities::IdentityVerification::IdentityVerificationClient.new(api_client, configuration)
|
|
157
|
+
@face_authentication =
|
|
158
|
+
CheckoutSdk::Identities::FaceAuthentication::FaceAuthenticationClient.new(api_client, configuration)
|
|
159
|
+
@apple_pay = CheckoutSdk::Payments::ApplePayClient.new(api_client, configuration)
|
|
160
|
+
@google_pay = CheckoutSdk::Payments::GooglePayClient.new(api_client, configuration)
|
|
101
161
|
end
|
|
102
162
|
|
|
103
163
|
private
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Common
|
|
5
|
+
# Optional HTTP headers that callers can pass to a client method, mirroring
|
|
6
|
+
# the SDK's `Headers` pattern. Currently exposes `If-Match` (required
|
|
7
|
+
# by endpoints with optimistic-concurrency semantics, e.g. update reserve
|
|
8
|
+
# rule); future shared headers can be added here.
|
|
9
|
+
#
|
|
10
|
+
# @!attribute if_match
|
|
11
|
+
# @return [String] ETag value to forward as the `If-Match` HTTP header.
|
|
12
|
+
class Headers
|
|
13
|
+
attr_accessor :if_match
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module ComplianceRequests
|
|
5
|
+
# A single responded field for a compliance request. Matches swagger
|
|
6
|
+
# `ComplianceRequestRespondedField`.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute name
|
|
9
|
+
# @return [String] The field name (e.g. "date_of_birth").
|
|
10
|
+
# @!attribute value
|
|
11
|
+
# The value provided for the field. Intentionally untyped per swagger
|
|
12
|
+
# (no `type` declaration, `nullable: true`), so the only valid Ruby
|
|
13
|
+
# annotation is `Object`. Concrete shape depends on the field being
|
|
14
|
+
# responded to (e.g. a date string for `date_of_birth`).
|
|
15
|
+
# @return [Object]
|
|
16
|
+
# @!attribute not_available
|
|
17
|
+
# @return [Boolean] Whether the value is unavailable for this field.
|
|
18
|
+
class ComplianceRequestRespondedField
|
|
19
|
+
attr_accessor :name, :value, :not_available
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module ComplianceRequests
|
|
5
|
+
# Groups responded fields by party (sender/recipient).
|
|
6
|
+
#
|
|
7
|
+
# @!attribute sender
|
|
8
|
+
# @return [Array<ComplianceRequestRespondedField>]
|
|
9
|
+
# @!attribute recipient
|
|
10
|
+
# @return [Array<ComplianceRequestRespondedField>]
|
|
11
|
+
class ComplianceRequestRespondedFields
|
|
12
|
+
attr_accessor :sender, :recipient
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'checkout_sdk/compliance_requests/compliance_request_responded_field'
|
|
4
|
+
require 'checkout_sdk/compliance_requests/compliance_request_responded_fields'
|
|
5
|
+
require 'checkout_sdk/compliance_requests/compliance_response_request'
|
|
6
|
+
require 'checkout_sdk/compliance_requests/compliance_requests_client'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module ComplianceRequests
|
|
5
|
+
# Client for the Compliance Requests API.
|
|
6
|
+
class ComplianceRequestsClient < Client
|
|
7
|
+
COMPLIANCE_REQUESTS = 'compliance-requests'
|
|
8
|
+
private_constant :COMPLIANCE_REQUESTS
|
|
9
|
+
|
|
10
|
+
# @param [ApiClient] api_client
|
|
11
|
+
# @param [CheckoutConfiguration] configuration
|
|
12
|
+
def initialize(api_client, configuration)
|
|
13
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Retrieve an existing compliance request by payment ID.
|
|
17
|
+
# @param [String] payment_id
|
|
18
|
+
def get_compliance_request(payment_id)
|
|
19
|
+
api_client.invoke_get(build_path(COMPLIANCE_REQUESTS, payment_id), sdk_authorization)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Respond to a compliance request.
|
|
23
|
+
# @param [String] payment_id
|
|
24
|
+
# @param [Hash, ComplianceResponseRequest] compliance_response_request
|
|
25
|
+
def respond_to_compliance_request(payment_id, compliance_response_request)
|
|
26
|
+
api_client.invoke_post(
|
|
27
|
+
build_path(COMPLIANCE_REQUESTS, payment_id),
|
|
28
|
+
sdk_authorization,
|
|
29
|
+
compliance_response_request
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module ComplianceRequests
|
|
5
|
+
# Request body for POST /compliance-requests/{payment_id}.
|
|
6
|
+
# Used to respond to a compliance information request raised against a payment.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute fields
|
|
9
|
+
# @return [ComplianceRequestRespondedFields]
|
|
10
|
+
# @!attribute comments
|
|
11
|
+
# @return [String] Optional free-text comment.
|
|
12
|
+
class ComplianceResponseRequest
|
|
13
|
+
attr_accessor :fields, :comments
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -13,6 +13,7 @@ module CheckoutSdk
|
|
|
13
13
|
ARBITRATION_LOST = 'arbitration_lost'
|
|
14
14
|
EVIDENCE_REQUIRED = 'evidence_required'
|
|
15
15
|
EVIDENCE_UNDER_REVIEW = 'evidence_under_review'
|
|
16
|
+
ARB_EVIDENCE_SUBMITTED = 'arb_evidence_submitted'
|
|
16
17
|
ARBITRATION_UNDER_REVIEW = 'arbitration_under_review'
|
|
17
18
|
end
|
|
18
19
|
end
|
|
@@ -9,7 +9,8 @@ module CheckoutSdk
|
|
|
9
9
|
EVIDENCE = 'evidence'
|
|
10
10
|
SUBMITTED = 'submitted'
|
|
11
11
|
SCHEME_FILES = 'schemefiles'
|
|
12
|
-
|
|
12
|
+
ARBITRATION = 'arbitration'
|
|
13
|
+
private_constant :DISPUTES, :FILES, :ACCEPT, :EVIDENCE, :SCHEME_FILES, :ARBITRATION
|
|
13
14
|
|
|
14
15
|
# @param [ApiClient] api_client
|
|
15
16
|
# @param [CheckoutConfiguration] configuration
|
|
@@ -67,6 +68,26 @@ module CheckoutSdk
|
|
|
67
68
|
def get_file_details(file_id)
|
|
68
69
|
api_client.invoke_get(build_path(FILES, file_id), sdk_authorization)
|
|
69
70
|
end
|
|
71
|
+
|
|
72
|
+
# Submit arbitration evidence on a dispute.
|
|
73
|
+
# @param [String] dispute_id
|
|
74
|
+
# @param [Hash, DisputeArbitrationRequest] arbitration_request
|
|
75
|
+
def submit_arbitration(dispute_id, arbitration_request = nil)
|
|
76
|
+
api_client.invoke_post(
|
|
77
|
+
build_path(DISPUTES, dispute_id, EVIDENCE, ARBITRATION),
|
|
78
|
+
sdk_authorization,
|
|
79
|
+
arbitration_request
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Retrieve submitted arbitration evidence.
|
|
84
|
+
# @param [String] dispute_id
|
|
85
|
+
def get_submitted_arbitration_evidence(dispute_id)
|
|
86
|
+
api_client.invoke_get(
|
|
87
|
+
build_path(DISPUTES, dispute_id, EVIDENCE, ARBITRATION, SUBMITTED),
|
|
88
|
+
sdk_authorization
|
|
89
|
+
)
|
|
90
|
+
end
|
|
70
91
|
end
|
|
71
92
|
end
|
|
72
93
|
end
|
|
@@ -3,27 +3,63 @@
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Disputes
|
|
5
5
|
# @!attribute limit
|
|
6
|
-
#
|
|
6
|
+
# The number of results to return.
|
|
7
|
+
# [Optional]
|
|
8
|
+
# min 1, max 250, default 50
|
|
9
|
+
# @return [Integer, nil]
|
|
7
10
|
# @!attribute skip
|
|
8
|
-
#
|
|
11
|
+
# The number of results to skip.
|
|
12
|
+
# [Optional]
|
|
13
|
+
# min 0, default 0
|
|
14
|
+
# @return [Integer, nil]
|
|
9
15
|
# @!attribute id
|
|
10
|
-
#
|
|
16
|
+
# The unique identifier of the dispute.
|
|
17
|
+
# [Optional]
|
|
18
|
+
# @return [String, nil]
|
|
11
19
|
# @!attribute statuses
|
|
12
|
-
#
|
|
20
|
+
# One or more comma-separated statuses to filter by. Works like a logical OR.
|
|
21
|
+
# [Optional]
|
|
22
|
+
# Example: "evidence_required,evidence_under_review"
|
|
23
|
+
# @return [String, nil]
|
|
13
24
|
# @!attribute payment_id
|
|
14
|
-
#
|
|
25
|
+
# The unique identifier of the payment.
|
|
26
|
+
# [Optional]
|
|
27
|
+
# @return [String, nil]
|
|
15
28
|
# @!attribute payment_reference
|
|
16
|
-
#
|
|
29
|
+
# An optional reference (such as an order ID) that identifies the payment.
|
|
30
|
+
# [Optional]
|
|
31
|
+
# @return [String, nil]
|
|
17
32
|
# @!attribute payment_arn
|
|
18
|
-
#
|
|
33
|
+
# The acquirer reference number (ARN).
|
|
34
|
+
# [Optional]
|
|
35
|
+
# @return [String, nil]
|
|
19
36
|
# @!attribute this_channel_only
|
|
20
|
-
#
|
|
37
|
+
# If true, only returns disputes for the channel associated with the secret key.
|
|
38
|
+
# [Optional]
|
|
39
|
+
# @return [TrueClass, FalseClass, nil]
|
|
21
40
|
# @!attribute entity_ids
|
|
22
|
-
#
|
|
41
|
+
# One or more comma-separated client entity IDs. Works like a logical OR.
|
|
42
|
+
# [Optional]
|
|
43
|
+
# Example: "ent_wxglze3wwywujg4nna5fb7ldli,ent_vkb5zcy64zoe3cwfmaqvqyqyku"
|
|
44
|
+
# @return [String, nil]
|
|
23
45
|
# @!attribute sub_entity_ids
|
|
24
|
-
#
|
|
46
|
+
# One or more comma-separated sub-entity IDs. Works like a logical OR.
|
|
47
|
+
# [Optional]
|
|
48
|
+
# Example: "ent_uzm3uxtssvmuxnyrfdffcyjxeu,ent_hy5wtzwzeuwefmsnjtdhw4scfi"
|
|
49
|
+
# @return [String, nil]
|
|
50
|
+
# @!attribute processing_channel_ids
|
|
51
|
+
# One or more comma-separated processing channel IDs. Works like a logical OR.
|
|
52
|
+
# [Optional]
|
|
53
|
+
# Example: "pc_uzm3uxtssvmuxnyrfdffcyjxeu,pc_hy5wtzwzeuwefmsnjtdhw4scfi"
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
# @!attribute segment_ids
|
|
56
|
+
# One or more comma-separated segment IDs. Works like a logical OR.
|
|
57
|
+
# [Optional]
|
|
58
|
+
# @return [String, nil]
|
|
25
59
|
# @!attribute payment_mcc
|
|
26
|
-
#
|
|
60
|
+
# The merchant category code (MCC) of the payment (ISO 18245).
|
|
61
|
+
# [Optional]
|
|
62
|
+
# @return [String, nil]
|
|
27
63
|
class DisputesQueryFilter < CheckoutSdk::Common::DateRangeQueryFilter
|
|
28
64
|
attr_accessor :limit,
|
|
29
65
|
:skip,
|
|
@@ -35,6 +71,8 @@ module CheckoutSdk
|
|
|
35
71
|
:this_channel_only,
|
|
36
72
|
:entity_ids,
|
|
37
73
|
:sub_entity_ids,
|
|
74
|
+
:processing_channel_ids,
|
|
75
|
+
:segment_ids,
|
|
38
76
|
:payment_mcc
|
|
39
77
|
end
|
|
40
78
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Forward
|
|
5
|
+
# Request body for POST /forward/secrets.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute name
|
|
8
|
+
# @return [String] Secret name (1-64 alphanumeric chars).
|
|
9
|
+
# @!attribute value
|
|
10
|
+
# @return [String] Plaintext secret value (max 8KB).
|
|
11
|
+
# @!attribute entity_id
|
|
12
|
+
# @return [String] Optional entity scope.
|
|
13
|
+
class CreateSecretRequest
|
|
14
|
+
attr_accessor :name, :value, :entity_id
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -4,7 +4,8 @@ module CheckoutSdk
|
|
|
4
4
|
module Forward
|
|
5
5
|
class ForwardClient < Client
|
|
6
6
|
FORWARD = 'forward'
|
|
7
|
-
|
|
7
|
+
SECRETS = 'secrets'
|
|
8
|
+
private_constant :FORWARD, :SECRETS
|
|
8
9
|
|
|
9
10
|
# @param [ApiClient] api_client
|
|
10
11
|
# @param [CheckoutConfiguration] configuration
|
|
@@ -21,6 +22,31 @@ module CheckoutSdk
|
|
|
21
22
|
def get(forward_id)
|
|
22
23
|
api_client.invoke_get(build_path(FORWARD, forward_id), sdk_authorization)
|
|
23
24
|
end
|
|
25
|
+
|
|
26
|
+
# @param [Hash, CreateSecretRequest] create_secret_request
|
|
27
|
+
def create_secret(create_secret_request)
|
|
28
|
+
api_client.invoke_post(build_path(FORWARD, SECRETS),
|
|
29
|
+
sdk_authorization,
|
|
30
|
+
create_secret_request)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def get_secrets
|
|
34
|
+
api_client.invoke_get(build_path(FORWARD, SECRETS), sdk_authorization)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @param [String] name
|
|
38
|
+
# @param [Hash, UpdateSecretRequest] update_secret_request
|
|
39
|
+
def update_secret(name, update_secret_request)
|
|
40
|
+
api_client.invoke_patch(build_path(FORWARD, SECRETS, name),
|
|
41
|
+
sdk_authorization,
|
|
42
|
+
update_secret_request)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @param [String] name
|
|
46
|
+
def delete_secret(name)
|
|
47
|
+
api_client.invoke_delete(build_path(FORWARD, SECRETS, name),
|
|
48
|
+
sdk_authorization)
|
|
49
|
+
end
|
|
24
50
|
end
|
|
25
51
|
end
|
|
26
52
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Forward
|
|
5
|
+
# Request body for PATCH /forward/secrets/{name}.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute value
|
|
8
|
+
# @return [String] New plaintext secret value (max 8KB).
|
|
9
|
+
# @!attribute entity_id
|
|
10
|
+
# @return [String] Update the entity scope.
|
|
11
|
+
class UpdateSecretRequest
|
|
12
|
+
attr_accessor :value, :entity_id
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Identities
|
|
5
|
+
module AmlScreening
|
|
6
|
+
# Client for the Identities — AML Screening API.
|
|
7
|
+
class AmlScreeningClient < Client
|
|
8
|
+
AML_VERIFICATIONS = 'aml-verifications'
|
|
9
|
+
private_constant :AML_VERIFICATIONS
|
|
10
|
+
|
|
11
|
+
# @param [ApiClient] api_client
|
|
12
|
+
# @param [CheckoutConfiguration] configuration
|
|
13
|
+
def initialize(api_client, configuration)
|
|
14
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# @param [Hash, AmlVerificationRequest] aml_verification_request
|
|
18
|
+
def create_aml_verification(aml_verification_request)
|
|
19
|
+
api_client.invoke_post(AML_VERIFICATIONS, sdk_authorization, aml_verification_request)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# @param [String] aml_verification_id
|
|
23
|
+
def get_aml_verification(aml_verification_id)
|
|
24
|
+
api_client.invoke_get(build_path(AML_VERIFICATIONS, aml_verification_id), sdk_authorization)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|