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.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +15 -1
  3. data/lib/checkout_sdk/accounts/accounts.rb +10 -1
  4. data/lib/checkout_sdk/accounts/accounts_client.rb +134 -1
  5. data/lib/checkout_sdk/accounts/entity_files_request.rb +13 -0
  6. data/lib/checkout_sdk/accounts/entity_requirement_priority.rb +12 -0
  7. data/lib/checkout_sdk/accounts/entity_requirement_reason.rb +11 -0
  8. data/lib/checkout_sdk/accounts/entity_requirement_update_request.rb +22 -0
  9. data/lib/checkout_sdk/accounts/entity_requirement_update_status.rb +12 -0
  10. data/lib/checkout_sdk/accounts/onboard_entity.rb +9 -1
  11. data/lib/checkout_sdk/accounts/reserve_rule_create_request.rb +14 -0
  12. data/lib/checkout_sdk/accounts/reserve_rule_holding_duration.rb +13 -0
  13. data/lib/checkout_sdk/accounts/reserve_rule_update_request.rb +15 -0
  14. data/lib/checkout_sdk/accounts/rolling_reserve_rule.rb +15 -0
  15. data/lib/checkout_sdk/accounts/submitter.rb +13 -0
  16. data/lib/checkout_sdk/agentic_commerce/agentic_commerce.rb +8 -0
  17. data/lib/checkout_sdk/agentic_commerce/agentic_commerce_client.rb +31 -0
  18. data/lib/checkout_sdk/agentic_commerce/delegated_payment_allowance.rb +28 -0
  19. data/lib/checkout_sdk/agentic_commerce/delegated_payment_billing_address.rb +33 -0
  20. data/lib/checkout_sdk/agentic_commerce/delegated_payment_method_card.rb +64 -0
  21. data/lib/checkout_sdk/agentic_commerce/delegated_payment_request.rb +25 -0
  22. data/lib/checkout_sdk/agentic_commerce/delegated_payment_risk_signal.rb +20 -0
  23. data/lib/checkout_sdk/api_client.rb +25 -15
  24. data/lib/checkout_sdk/balances/balance_values.rb +28 -0
  25. data/lib/checkout_sdk/balances/balances.rb +4 -0
  26. data/lib/checkout_sdk/balances/balances_query.rb +32 -0
  27. data/lib/checkout_sdk/balances/collateral_breakdown.rb +16 -0
  28. data/lib/checkout_sdk/balances/currency_account_balance.rb +26 -0
  29. data/lib/checkout_sdk/checkout_api.rb +61 -1
  30. data/lib/checkout_sdk/common/common.rb +1 -0
  31. data/lib/checkout_sdk/common/headers.rb +16 -0
  32. data/lib/checkout_sdk/common/payment_source_type.rb +1 -0
  33. data/lib/checkout_sdk/compliance_requests/compliance_request_responded_field.rb +22 -0
  34. data/lib/checkout_sdk/compliance_requests/compliance_request_responded_fields.rb +15 -0
  35. data/lib/checkout_sdk/compliance_requests/compliance_requests.rb +6 -0
  36. data/lib/checkout_sdk/compliance_requests/compliance_requests_client.rb +34 -0
  37. data/lib/checkout_sdk/compliance_requests/compliance_response_request.rb +16 -0
  38. data/lib/checkout_sdk/disputes/dispute_status.rb +1 -0
  39. data/lib/checkout_sdk/disputes/disputes_client.rb +22 -1
  40. data/lib/checkout_sdk/disputes/disputes_query_filter.rb +49 -11
  41. data/lib/checkout_sdk/forward/create_secret_request.rb +17 -0
  42. data/lib/checkout_sdk/forward/forward.rb +2 -0
  43. data/lib/checkout_sdk/forward/forward_client.rb +27 -1
  44. data/lib/checkout_sdk/forward/update_secret_request.rb +15 -0
  45. data/lib/checkout_sdk/identities/aml_screening/aml_screening_client.rb +29 -0
  46. data/lib/checkout_sdk/identities/aml_screening/aml_search_parameters.rb +15 -0
  47. data/lib/checkout_sdk/identities/aml_screening/aml_verification_request.rb +19 -0
  48. data/lib/checkout_sdk/identities/applicants/applicants_client.rb +43 -0
  49. data/lib/checkout_sdk/identities/applicants/create_applicant_request.rb +21 -0
  50. data/lib/checkout_sdk/identities/applicants/update_applicant_request.rb +18 -0
  51. data/lib/checkout_sdk/identities/face_authentication/face_authentication_attempt_request.rb +17 -0
  52. data/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +68 -0
  53. data/lib/checkout_sdk/identities/face_authentication/face_authentication_request.rb +21 -0
  54. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_client.rb +77 -0
  55. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_request.rb +27 -0
  56. data/lib/checkout_sdk/identities/identities.rb +27 -0
  57. data/lib/checkout_sdk/identities/identity_verification/identity_verification_attempt_request.rb +17 -0
  58. data/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +84 -0
  59. data/lib/checkout_sdk/identities/identity_verification/identity_verification_request.rb +21 -0
  60. data/lib/checkout_sdk/identities/identity_verification/idv_client_information.rb +17 -0
  61. data/lib/checkout_sdk/identities/identity_verification/idv_declared_data.rb +15 -0
  62. data/lib/checkout_sdk/instruments/base_instruments_client.rb +9 -0
  63. data/lib/checkout_sdk/issuing/add_control_group_request.rb +19 -0
  64. data/lib/checkout_sdk/issuing/add_control_profile_request.rb +13 -0
  65. data/lib/checkout_sdk/issuing/cardholder_access_token_request.rb +26 -0
  66. data/lib/checkout_sdk/issuing/create_dispute_request.rb +24 -0
  67. data/lib/checkout_sdk/issuing/escalate_dispute_request.rb +19 -0
  68. data/lib/checkout_sdk/issuing/identification_document.rb +18 -0
  69. data/lib/checkout_sdk/issuing/issuing.rb +25 -0
  70. data/lib/checkout_sdk/issuing/issuing_address.rb +25 -0
  71. data/lib/checkout_sdk/issuing/issuing_client.rb +266 -13
  72. data/lib/checkout_sdk/issuing/issuing_phone_number.rb +16 -0
  73. data/lib/checkout_sdk/issuing/oob_authentication_request.rb +15 -0
  74. data/lib/checkout_sdk/issuing/oob_simulate_transaction_details.rb +19 -0
  75. data/lib/checkout_sdk/issuing/schedule_revocation_request.rb +13 -0
  76. data/lib/checkout_sdk/issuing/simulate_refund_request.rb +13 -0
  77. data/lib/checkout_sdk/issuing/update_card_request.rb +19 -0
  78. data/lib/checkout_sdk/issuing/update_cardholder_request.rb +32 -0
  79. data/lib/checkout_sdk/issuing/update_control_profile_request.rb +13 -0
  80. data/lib/checkout_sdk/network_tokens/network_token_cryptogram_request.rb +13 -0
  81. data/lib/checkout_sdk/network_tokens/network_token_source_card.rb +25 -0
  82. data/lib/checkout_sdk/network_tokens/network_token_source_id.rb +19 -0
  83. data/lib/checkout_sdk/network_tokens/network_tokens.rb +7 -0
  84. data/lib/checkout_sdk/network_tokens/network_tokens_client.rb +51 -0
  85. data/lib/checkout_sdk/network_tokens/provision_network_token_request.rb +14 -0
  86. data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator.rb +6 -0
  87. data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb +72 -0
  88. data/lib/checkout_sdk/onboarding_simulator/simulator_entity_status.rb +16 -0
  89. data/lib/checkout_sdk/onboarding_simulator/simulator_set_requirements_due_request.rb +14 -0
  90. data/lib/checkout_sdk/onboarding_simulator/simulator_set_status_request.rb +13 -0
  91. data/lib/checkout_sdk/payment_methods/payment_methods.rb +4 -0
  92. data/lib/checkout_sdk/payment_methods/payment_methods_client.rb +24 -0
  93. data/lib/checkout_sdk/payment_methods/payment_methods_query.rb +13 -0
  94. data/lib/checkout_sdk/payments/apple_pay/apple_pay_certificate_request.rb +13 -0
  95. data/lib/checkout_sdk/payments/apple_pay/apple_pay_client.rb +44 -0
  96. data/lib/checkout_sdk/payments/apple_pay/apple_pay_enrollment_request.rb +13 -0
  97. data/lib/checkout_sdk/payments/apple_pay/apple_pay_signing_request.rb +13 -0
  98. data/lib/checkout_sdk/payments/base_payments_client.rb +19 -0
  99. data/lib/checkout_sdk/payments/cancellation_request.rb +13 -0
  100. data/lib/checkout_sdk/payments/flow/flow_client.rb +59 -0
  101. data/lib/checkout_sdk/payments/google_pay/google_pay_client.rb +48 -0
  102. data/lib/checkout_sdk/payments/google_pay/google_pay_domain_request.rb +13 -0
  103. data/lib/checkout_sdk/payments/google_pay/google_pay_enrollment_request.rb +17 -0
  104. data/lib/checkout_sdk/payments/passenger.rb +20 -6
  105. data/lib/checkout_sdk/payments/payment_plan.rb +43 -0
  106. data/lib/checkout_sdk/payments/payment_request.rb +2 -1
  107. data/lib/checkout_sdk/payments/payments.rb +26 -1
  108. data/lib/checkout_sdk/payments/payments_search_request.rb +20 -0
  109. data/lib/checkout_sdk/payments/processing_data.rb +45 -0
  110. data/lib/checkout_sdk/payments/processing_settings.rb +5 -1
  111. data/lib/checkout_sdk/payments/sessions/payment_sessions_client.rb +12 -0
  112. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification.rb +17 -0
  113. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification_type.rb +15 -0
  114. data/lib/checkout_sdk/payments/setups/account_funding_transaction_purpose.rb +29 -0
  115. data/lib/checkout_sdk/payments/setups/account_funding_transaction_recipient.rb +26 -0
  116. data/lib/checkout_sdk/payments/setups/account_funding_transaction_sender.rb +29 -0
  117. data/lib/checkout_sdk/payments/setups/blik_payment_method.rb +20 -0
  118. data/lib/checkout_sdk/payments/setups/payment_setup_account_funding_transaction.rb +20 -0
  119. data/lib/checkout_sdk/payments/source/apm/blik_source.rb +31 -0
  120. data/lib/checkout_sdk/sessions/device_information.rb +17 -0
  121. data/lib/checkout_sdk/sessions/session_request.rb +2 -1
  122. data/lib/checkout_sdk/sessions/sessions.rb +1 -0
  123. data/lib/checkout_sdk/standalone_account_updater/account_updater_card.rb +17 -0
  124. data/lib/checkout_sdk/standalone_account_updater/account_updater_instrument.rb +13 -0
  125. data/lib/checkout_sdk/standalone_account_updater/account_updater_request.rb +13 -0
  126. data/lib/checkout_sdk/standalone_account_updater/account_updater_source_options.rb +15 -0
  127. data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater.rb +7 -0
  128. data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater_client.rb +29 -0
  129. data/lib/checkout_sdk/tokens/token_metadata_billing_address.rb +16 -0
  130. data/lib/checkout_sdk/tokens/token_metadata_response.rb +55 -0
  131. data/lib/checkout_sdk/tokens/tokens.rb +2 -0
  132. data/lib/checkout_sdk/tokens/tokens_client.rb +11 -0
  133. data/lib/checkout_sdk/version.rb +1 -1
  134. data/lib/checkout_sdk/workflows/workflows_client.rb +1 -1
  135. data/lib/checkout_sdk.rb +7 -0
  136. metadata +106 -4
  137. data/lib/checkout_sdk/accounts/headers.rb +0 -11
  138. data/lib/checkout_sdk/payments/passenger_name.rb +0 -11
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module OnboardingSimulator
5
+ # Client for the Onboarding Simulator API (Sandbox only).
6
+ #
7
+ # All endpoints require OAuth with the `accounts` scope. Calling these
8
+ # endpoints in Production returns 404.
9
+ class OnboardingSimulatorClient < Client
10
+ SIMULATE = 'simulate'
11
+ ENTITIES = 'entities'
12
+ REQUIREMENTS_DUE = 'requirements-due'
13
+ SCENARIOS = 'scenarios'
14
+ STATUS = 'status'
15
+ private_constant :SIMULATE, :ENTITIES, :REQUIREMENTS_DUE, :SCENARIOS, :STATUS
16
+
17
+ # @param [ApiClient] api_client
18
+ # @param [CheckoutConfiguration] configuration
19
+ def initialize(api_client, configuration)
20
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
21
+ end
22
+
23
+ # Marks the specified requirement fields as due on an entity.
24
+ # @param [String] entity_id
25
+ # @param [Hash, SimulatorSetRequirementsDueRequest] request
26
+ def set_requirements_due(entity_id, request)
27
+ api_client.invoke_post(
28
+ build_path(SIMULATE, ENTITIES, entity_id, REQUIREMENTS_DUE),
29
+ sdk_authorization,
30
+ request
31
+ )
32
+ end
33
+
34
+ # Executes a pre-defined scenario against an entity.
35
+ # @param [String] entity_id
36
+ # @param [String] scenario_id
37
+ def run_scenario(entity_id, scenario_id)
38
+ api_client.invoke_post(
39
+ build_path(SIMULATE, ENTITIES, entity_id, SCENARIOS, scenario_id),
40
+ sdk_authorization
41
+ )
42
+ end
43
+
44
+ # Forces the entity to the specified status.
45
+ # @param [String] entity_id
46
+ # @param [Hash, SimulatorSetStatusRequest] request
47
+ def set_entity_status(entity_id, request)
48
+ api_client.invoke_post(
49
+ build_path(SIMULATE, ENTITIES, entity_id, STATUS),
50
+ sdk_authorization,
51
+ request
52
+ )
53
+ end
54
+
55
+ # Returns all requirement fields that can be set as due on an entity.
56
+ def list_available_requirements
57
+ api_client.invoke_get(
58
+ build_path(SIMULATE, REQUIREMENTS_DUE),
59
+ sdk_authorization
60
+ )
61
+ end
62
+
63
+ # Returns all pre-defined scenarios available.
64
+ def list_scenarios
65
+ api_client.invoke_get(
66
+ build_path(SIMULATE, SCENARIOS),
67
+ sdk_authorization
68
+ )
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module OnboardingSimulator
5
+ # Statuses accepted by POST /simulate/entities/{entityId}/status.
6
+ module SimulatorEntityStatus
7
+ DRAFT = 'draft'
8
+ REQUIREMENTS_DUE = 'requirements_due'
9
+ PENDING = 'pending'
10
+ ACTIVE = 'active'
11
+ RESTRICTED = 'restricted'
12
+ REJECTED = 'rejected'
13
+ INACTIVE = 'inactive'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module OnboardingSimulator
5
+ # Request body for POST /simulate/entities/{entityId}/requirements-due.
6
+ #
7
+ # @!attribute fields
8
+ # @return [Array(String)] Requirement field paths to mark as due
9
+ # (e.g. ["individual.identification.document"]).
10
+ class SimulatorSetRequirementsDueRequest
11
+ attr_accessor :fields
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module OnboardingSimulator
5
+ # Request body for POST /simulate/entities/{entityId}/status.
6
+ #
7
+ # @!attribute status
8
+ # @return [String] {SimulatorEntityStatus}
9
+ class SimulatorSetStatusRequest
10
+ attr_accessor :status
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/payment_methods/payment_methods_query'
4
+ require 'checkout_sdk/payment_methods/payment_methods_client'
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module PaymentMethods
5
+ # Client for the Payment Methods configuration API.
6
+ # GET /payment-methods returns the configured payment methods for a processing channel.
7
+ class PaymentMethodsClient < Client
8
+ PAYMENT_METHODS = 'payment-methods'
9
+ private_constant :PAYMENT_METHODS
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
+ # Get available payment methods.
18
+ # @param [Hash, PaymentMethodsQuery] payment_methods_query
19
+ def get_payment_methods(payment_methods_query)
20
+ api_client.invoke_get(PAYMENT_METHODS, sdk_authorization, payment_methods_query)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module PaymentMethods
5
+ # Query params for GET /payment-methods.
6
+ #
7
+ # @!attribute processing_channel_id
8
+ # @return [String] (required) Pattern: ^(pc)_(\w{26})$
9
+ class PaymentMethodsQuery
10
+ attr_accessor :processing_channel_id
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /applepay/certificates.
6
+ #
7
+ # @!attribute content
8
+ # @return [String] PEM-encoded certificate content.
9
+ class ApplePayCertificateRequest
10
+ attr_accessor :content
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Client for the Apple Pay endpoints.
6
+ class ApplePayClient < Client
7
+ APPLEPAY = 'applepay'
8
+ CERTIFICATES = 'certificates'
9
+ ENROLLMENTS = 'enrollments'
10
+ SIGNING_REQUESTS = 'signing-requests'
11
+ private_constant :APPLEPAY, :CERTIFICATES, :ENROLLMENTS, :SIGNING_REQUESTS
12
+
13
+ # @param [ApiClient] api_client
14
+ # @param [CheckoutConfiguration] configuration
15
+ def initialize(api_client, configuration)
16
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::PUBLIC_KEY)
17
+ end
18
+
19
+ # Upload a payment processing certificate. Public key auth per swagger.
20
+ # @param [Hash, ApplePayCertificateRequest] certificate_request
21
+ def upload_certificate(certificate_request)
22
+ api_client.invoke_post(build_path(APPLEPAY, CERTIFICATES),
23
+ sdk_authorization,
24
+ certificate_request)
25
+ end
26
+
27
+ # Enroll a domain to the Apple Pay Service. OAuth required.
28
+ # @param [Hash, ApplePayEnrollmentRequest] enrollment_request
29
+ def enroll_domain(enrollment_request)
30
+ api_client.invoke_post(build_path(APPLEPAY, ENROLLMENTS),
31
+ sdk_authorization(CheckoutSdk::AuthorizationType::OAUTH),
32
+ enrollment_request)
33
+ end
34
+
35
+ # Generate a certificate signing request. Public key auth per swagger.
36
+ # @param [Hash, ApplePaySigningRequest] signing_request
37
+ def generate_signing_request(signing_request)
38
+ api_client.invoke_post(build_path(APPLEPAY, SIGNING_REQUESTS),
39
+ sdk_authorization,
40
+ signing_request)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /applepay/enrollments.
6
+ #
7
+ # @!attribute domain
8
+ # @return [String] Domain to enroll with Apple Pay.
9
+ class ApplePayEnrollmentRequest
10
+ attr_accessor :domain
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /applepay/signing-requests.
6
+ #
7
+ # @!attribute protocol_version
8
+ # @return [String] CSR protocol version.
9
+ class ApplePaySigningRequest
10
+ attr_accessor :protocol_version
11
+ end
12
+ end
13
+ end
@@ -51,6 +51,25 @@ module CheckoutSdk
51
51
  reverse_request,
52
52
  idempotency_key)
53
53
  end
54
+
55
+ # Search payments. POST /payments/search.
56
+ # @param [Hash, PaymentsSearchRequest] search_request
57
+ def search_payments(search_request)
58
+ api_client.invoke_post(build_path(PAYMENTS_PATH, 'search'),
59
+ sdk_authorization,
60
+ search_request)
61
+ end
62
+
63
+ # Cancel a scheduled retry. POST /payments/{id}/cancellations.
64
+ # @param [String] payment_id
65
+ # @param [Hash, CancellationRequest] cancellation_request
66
+ # @param [String, nil] idempotency_key
67
+ def cancel_payment(payment_id, cancellation_request = nil, idempotency_key = nil)
68
+ api_client.invoke_post(build_path(PAYMENTS_PATH, payment_id, 'cancellations'),
69
+ sdk_authorization,
70
+ cancellation_request,
71
+ idempotency_key)
72
+ end
54
73
  end
55
74
  end
56
75
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /payments/{id}/cancellations.
6
+ #
7
+ # @!attribute reference
8
+ # @return [String] Optional merchant reference (max 80 chars).
9
+ class CancellationRequest
10
+ attr_accessor :reference
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Client for Payment Flow API operations
6
+ # [Beta]
7
+ class FlowClient < Client
8
+ PAYMENT_SESSIONS_PATH = 'payment-sessions'
9
+ SUBMIT_PATH = 'submit'
10
+ COMPLETE_PATH = 'complete'
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
+ # Creates a Payment Session.
19
+ # Use this endpoint to set up a payment session before collecting payment details from your customer.
20
+ # [Beta]
21
+ #
22
+ # @param [Hash] request_payment_session_request
23
+ def request_payment_session(request_payment_session_request)
24
+ api_client.invoke_post(
25
+ build_path(PAYMENT_SESSIONS_PATH),
26
+ sdk_authorization,
27
+ request_payment_session_request
28
+ )
29
+ end
30
+
31
+ # Submits a Payment Session.
32
+ # Use this endpoint to submit payment details and process the payment for an existing session.
33
+ # [Beta]
34
+ #
35
+ # @param [String] id - The unique identifier of the Payment Session
36
+ # @param [Hash] submit_payment_session_request
37
+ def submit_payment_session(id, submit_payment_session_request)
38
+ api_client.invoke_post(
39
+ build_path(PAYMENT_SESSIONS_PATH, id, SUBMIT_PATH),
40
+ sdk_authorization,
41
+ submit_payment_session_request
42
+ )
43
+ end
44
+
45
+ # Creates and submits a Payment Session in a single request.
46
+ # Use this endpoint to create a payment session and immediately process the payment.
47
+ # [Beta]
48
+ #
49
+ # @param [Hash] request_payment_session_with_payment_request
50
+ def request_payment_session_with_payment(request_payment_session_with_payment_request)
51
+ api_client.invoke_post(
52
+ build_path(PAYMENT_SESSIONS_PATH, COMPLETE_PATH),
53
+ sdk_authorization,
54
+ request_payment_session_with_payment_request
55
+ )
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Client for the Google Pay endpoints. All endpoints require OAuth.
6
+ class GooglePayClient < Client
7
+ GOOGLEPAY = 'googlepay'
8
+ ENROLLMENTS = 'enrollments'
9
+ DOMAIN = 'domain'
10
+ DOMAINS = 'domains'
11
+ STATE = 'state'
12
+ private_constant :GOOGLEPAY, :ENROLLMENTS, :DOMAIN, :DOMAINS, :STATE
13
+
14
+ # @param [ApiClient] api_client
15
+ # @param [CheckoutConfiguration] configuration
16
+ def initialize(api_client, configuration)
17
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
18
+ end
19
+
20
+ # @param [Hash, GooglePayEnrollmentRequest] enrollment_request
21
+ def enroll_entity(enrollment_request)
22
+ api_client.invoke_post(build_path(GOOGLEPAY, ENROLLMENTS),
23
+ sdk_authorization,
24
+ enrollment_request)
25
+ end
26
+
27
+ # @param [String] entity_id
28
+ # @param [Hash, GooglePayDomainRequest] domain_request
29
+ def register_domain(entity_id, domain_request)
30
+ api_client.invoke_post(build_path(GOOGLEPAY, ENROLLMENTS, entity_id, DOMAIN),
31
+ sdk_authorization,
32
+ domain_request)
33
+ end
34
+
35
+ # @param [String] entity_id
36
+ def get_registered_domains(entity_id)
37
+ api_client.invoke_get(build_path(GOOGLEPAY, ENROLLMENTS, entity_id, DOMAINS),
38
+ sdk_authorization)
39
+ end
40
+
41
+ # @param [String] entity_id
42
+ def get_enrollment_state(entity_id)
43
+ api_client.invoke_get(build_path(GOOGLEPAY, ENROLLMENTS, entity_id, STATE),
44
+ sdk_authorization)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /googlepay/enrollments/{entity_id}/domain.
6
+ #
7
+ # @!attribute web_domain
8
+ # @return [String] Web domain to register for the enrolled entity.
9
+ class GooglePayDomainRequest
10
+ attr_accessor :web_domain
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /googlepay/enrollments.
6
+ #
7
+ # @!attribute entity_id
8
+ # @return [String] Entity to enroll.
9
+ # @!attribute email_address
10
+ # @return [String]
11
+ # @!attribute accept_terms_of_service
12
+ # @return [Boolean]
13
+ class GooglePayEnrollmentRequest
14
+ attr_accessor :entity_id, :email_address, :accept_terms_of_service
15
+ end
16
+ end
17
+ end
@@ -2,16 +2,30 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
- # @!attribute name
5
+ # Contains information about a passenger on the flight
6
+ # (PaymentInterfacesProcessingAirlinePassengerData).
7
+ #
8
+ # @!attribute first_name
6
9
  # @return [String]
7
- # @!attribute date_of_birth
10
+ # @!attribute last_name
8
11
  # @return [String]
9
- # @!attribute country_code
10
- # @return [String] {CheckoutSdk::Common::Country}
12
+ # @!attribute date_of_birth
13
+ # @return [String] Format: YYYY-MM-DD
14
+ # @!attribute address
15
+ # @return [PassengerAddress]
11
16
  class Passenger
12
- attr_accessor :name,
17
+ attr_accessor :first_name,
18
+ :last_name,
13
19
  :date_of_birth,
14
- :country_code
20
+ :address
21
+ end
22
+
23
+ # Partial address information for an airline passenger.
24
+ #
25
+ # @!attribute country
26
+ # @return [String] {CheckoutSdk::Common::Country}
27
+ class PassengerAddress
28
+ attr_accessor :country
15
29
  end
16
30
  end
17
31
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Details of a recurring subscription or installment plan associated with a payment.
6
+ #
7
+ # @!attribute amount_variability
8
+ # @return [String] Recurring-only. One of "Fixed" or "Variable".
9
+ # @!attribute financing
10
+ # @return [TrueClass, FalseClass] Installment-only.
11
+ # @!attribute amount
12
+ # @return [Integer] The amount to charge for each payment in the plan, in the minor currency unit.
13
+ # Required when source.type is "blik", amount_variability is "Fixed", and the recurring
14
+ # agreement is created without an initial payment (amount set to 0).
15
+ # @!attribute days_between_payments
16
+ # @return [Integer]
17
+ # @!attribute total_number_of_payments
18
+ # @return [Integer]
19
+ # @!attribute current_payment_number
20
+ # @return [Integer]
21
+ # @!attribute expiry
22
+ # @return [String] ISO 8601 date-time
23
+ # @!attribute name
24
+ # @return [String] The name of the payment plan. Required when source.type is "blik".
25
+ # For Blik merchant-initiated requests using an external partner_agreement_id, this value
26
+ # is used as the Blik Alias Label. Max 35 characters.
27
+ # @!attribute start_date
28
+ # @return [String] The date on which the first payment will be taken, in YYYYMMDD format.
29
+ # Required when source.type is "blik" and the recurring agreement is created without an
30
+ # initial payment (amount set to 0).
31
+ class PaymentPlan
32
+ attr_accessor :amount_variability,
33
+ :financing,
34
+ :amount,
35
+ :days_between_payments,
36
+ :total_number_of_payments,
37
+ :current_payment_number,
38
+ :expiry,
39
+ :name,
40
+ :start_date
41
+ end
42
+ end
43
+ end
@@ -99,7 +99,8 @@ module CheckoutSdk
99
99
  :items,
100
100
  :retry,
101
101
  :metadata,
102
- :instruction
102
+ :instruction,
103
+ :fallback_source
103
104
  end
104
105
  end
105
106
  end
@@ -16,6 +16,8 @@ require 'checkout_sdk/payments/os_type'
16
16
  require 'checkout_sdk/payments/payment_instruction'
17
17
  require 'checkout_sdk/payments/payment_method_details'
18
18
  require 'checkout_sdk/payments/refund_request'
19
+ require 'checkout_sdk/payments/payments_search_request'
20
+ require 'checkout_sdk/payments/cancellation_request'
19
21
  require 'checkout_sdk/payments/product'
20
22
  require 'checkout_sdk/payments/refund_order'
21
23
  require 'checkout_sdk/payments/capture_type'
@@ -32,8 +34,9 @@ require 'checkout_sdk/payments/exemption'
32
34
  require 'checkout_sdk/payments/three_ds_flow_type'
33
35
  require 'checkout_sdk/payments/void_request'
34
36
  require 'checkout_sdk/payments/payment_request'
35
- require 'checkout_sdk/payments/passenger_name'
36
37
  require 'checkout_sdk/payments/processing_settings'
38
+ require 'checkout_sdk/payments/processing_data'
39
+ require 'checkout_sdk/payments/payment_plan'
37
40
  require 'checkout_sdk/payments/charge_bearer'
38
41
  require 'checkout_sdk/payments/instruction_scheme'
39
42
  require 'checkout_sdk/payments/network_token_type'
@@ -66,6 +69,7 @@ require 'checkout_sdk/payments/source/apm/after_pay_source'
66
69
  require 'checkout_sdk/payments/source/apm/alipay_plus_source'
67
70
  require 'checkout_sdk/payments/source/apm/bancontact_source'
68
71
  require 'checkout_sdk/payments/source/apm/benefit_source'
72
+ require 'checkout_sdk/payments/source/apm/blik_source'
69
73
  require 'checkout_sdk/payments/source/apm/eps_source'
70
74
  require 'checkout_sdk/payments/source/apm/giropay_source'
71
75
  require 'checkout_sdk/payments/source/apm/ideal_source'
@@ -179,4 +183,25 @@ require 'checkout_sdk/payments/sessions/payment_methods_type'
179
183
  require 'checkout_sdk/payments/sessions/store_payment_details_type'
180
184
 
181
185
  # Payment Setups
186
+ require 'checkout_sdk/payments/setups/account_funding_transaction_purpose'
187
+ require 'checkout_sdk/payments/setups/account_funding_transaction_identification_type'
188
+ require 'checkout_sdk/payments/setups/account_funding_transaction_identification'
189
+ require 'checkout_sdk/payments/setups/account_funding_transaction_sender'
190
+ require 'checkout_sdk/payments/setups/account_funding_transaction_recipient'
191
+ require 'checkout_sdk/payments/setups/payment_setup_account_funding_transaction'
192
+ require 'checkout_sdk/payments/setups/blik_payment_method'
182
193
  require 'checkout_sdk/payments/setups/payment_setups_client'
194
+
195
+ # Payment Flow
196
+ require 'checkout_sdk/payments/flow/flow_client'
197
+
198
+ # Apple Pay
199
+ require 'checkout_sdk/payments/apple_pay/apple_pay_certificate_request'
200
+ require 'checkout_sdk/payments/apple_pay/apple_pay_enrollment_request'
201
+ require 'checkout_sdk/payments/apple_pay/apple_pay_signing_request'
202
+ require 'checkout_sdk/payments/apple_pay/apple_pay_client'
203
+
204
+ # Google Pay
205
+ require 'checkout_sdk/payments/google_pay/google_pay_enrollment_request'
206
+ require 'checkout_sdk/payments/google_pay/google_pay_domain_request'
207
+ require 'checkout_sdk/payments/google_pay/google_pay_client'
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Request body for POST /payments/search.
6
+ #
7
+ # @!attribute query
8
+ # @return [String] The query string (max 1024 chars).
9
+ # @!attribute limit
10
+ # @return [Integer] Results per page (1-1000, default 10).
11
+ # @!attribute from_
12
+ # @return [String] ISO 8601 UTC start. Required if `to` is set.
13
+ # Serialised as `from`.
14
+ # @!attribute to
15
+ # @return [String] ISO 8601 UTC end. Required if `from` is set.
16
+ class PaymentsSearchRequest
17
+ attr_accessor :query, :limit, :from_, :to
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Response-side `processing` object returned alongside payment responses.
6
+ # Distinct from {ProcessingSettings} which is the request-side equivalent.
7
+ #
8
+ # Mirrors the swagger ProcessingData schema:
9
+ # preferred_scheme, app_id, partner_*, tax_amount, locale, retrieval_reference_number,
10
+ # cko_network_token_available (SDK-only), aft, merchant_category_code, scheme_merchant_id,
11
+ # pan_type_processed, fallback_source_used, failure_code, partner_code, partner_response_code,
12
+ # scheme, partner_fraud_status, partner_merchant_advice_code, accommodation_data, airline_data,
13
+ # custom_payment_method_ids
14
+ class ProcessingData
15
+ attr_accessor :preferred_scheme,
16
+ :app_id,
17
+ :partner_customer_id,
18
+ :partner_payment_id,
19
+ :tax_amount,
20
+ :locale,
21
+ :retrieval_reference_number,
22
+ :partner_order_id,
23
+ :partner_status,
24
+ :partner_transaction_id,
25
+ :partner_error_codes,
26
+ :partner_error_message,
27
+ :partner_authorization_code,
28
+ :partner_authorization_response_code,
29
+ :partner_fraud_status,
30
+ :partner_merchant_advice_code,
31
+ :custom_payment_method_ids,
32
+ :aft,
33
+ :merchant_category_code,
34
+ :scheme_merchant_id,
35
+ :pan_type_processed,
36
+ :fallback_source_used,
37
+ :failure_code,
38
+ :partner_code,
39
+ :partner_response_code,
40
+ :scheme,
41
+ :accommodation_data,
42
+ :airline_data
43
+ end
44
+ end
45
+ end
@@ -72,6 +72,9 @@ module CheckoutSdk
72
72
  # @return [string]
73
73
  # @!attribute affiliate_url
74
74
  # @return [string]
75
+ # @!attribute partner_code
76
+ # @return [String] The customer's 6-digit BLIK code. Required when source.type is "blik"
77
+ # and merchant_initiated is false. Pattern: ^\d{6}$
75
78
  class ProcessingSettings
76
79
  attr_accessor :order_id,
77
80
  :tax_amount,
@@ -107,7 +110,8 @@ module CheckoutSdk
107
110
  :senderInformation,
108
111
  :purpose,
109
112
  :affiliate_id,
110
- :affiliate_url
113
+ :affiliate_url,
114
+ :partner_code
111
115
  end
112
116
  end
113
117
  end