checkout_sdk 1.2.2 → 1.9.1

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 (352) hide show
  1. checksums.yaml +4 -4
  2. data/.overcommit.yml +30 -0
  3. data/.rubocop.yml +15 -1
  4. data/.ruby-version +1 -0
  5. data/Gemfile +3 -1
  6. data/README.md +38 -0
  7. data/Rakefile +2 -2
  8. data/lib/checkout_sdk/accounts/account_holder.rb +10 -2
  9. data/lib/checkout_sdk/accounts/account_holder_corporate.rb +15 -0
  10. data/lib/checkout_sdk/accounts/account_holder_individual.rb +18 -0
  11. data/lib/checkout_sdk/accounts/accounts.rb +34 -1
  12. data/lib/checkout_sdk/accounts/accounts_client.rb +134 -1
  13. data/lib/checkout_sdk/accounts/additional_document.rb +11 -0
  14. data/lib/checkout_sdk/accounts/additional_info.rb +17 -0
  15. data/lib/checkout_sdk/accounts/articles_of_association_type.rb +10 -0
  16. data/lib/checkout_sdk/accounts/bank_verification.rb +14 -0
  17. data/lib/checkout_sdk/accounts/bank_verification_type.rb +9 -0
  18. data/lib/checkout_sdk/accounts/company.rb +7 -1
  19. data/lib/checkout_sdk/accounts/contact_details.rb +4 -1
  20. data/lib/checkout_sdk/accounts/date_of_incorporation.rb +14 -0
  21. data/lib/checkout_sdk/accounts/entity_files_request.rb +13 -0
  22. data/lib/checkout_sdk/accounts/entity_requirement_priority.rb +12 -0
  23. data/lib/checkout_sdk/accounts/entity_requirement_reason.rb +11 -0
  24. data/lib/checkout_sdk/accounts/entity_requirement_update_request.rb +22 -0
  25. data/lib/checkout_sdk/accounts/entity_requirement_update_status.rb +12 -0
  26. data/lib/checkout_sdk/accounts/financial_verification.rb +14 -0
  27. data/lib/checkout_sdk/accounts/financial_verification_type.rb +9 -0
  28. data/lib/checkout_sdk/accounts/instrument_details_ach.rb +21 -0
  29. data/lib/checkout_sdk/accounts/{headers.rb → invitee.rb} +3 -3
  30. data/lib/checkout_sdk/accounts/onboard_entity.rb +21 -4
  31. data/lib/checkout_sdk/accounts/onboard_sub_entity_documents.rb +31 -4
  32. data/lib/checkout_sdk/accounts/processing_details.rb +26 -0
  33. data/lib/checkout_sdk/accounts/proof_of_legality.rb +14 -0
  34. data/lib/checkout_sdk/accounts/proof_of_legality_type.rb +9 -0
  35. data/lib/checkout_sdk/accounts/proof_of_principal_address.rb +14 -0
  36. data/lib/checkout_sdk/accounts/proof_of_principal_address_type.rb +9 -0
  37. data/lib/checkout_sdk/accounts/reserve_rule_create_request.rb +14 -0
  38. data/lib/checkout_sdk/accounts/reserve_rule_holding_duration.rb +13 -0
  39. data/lib/checkout_sdk/accounts/reserve_rule_update_request.rb +15 -0
  40. data/lib/checkout_sdk/accounts/rolling_reserve_rule.rb +15 -0
  41. data/lib/checkout_sdk/accounts/schedule_frequency_daily.rb +1 -1
  42. data/lib/checkout_sdk/accounts/schedule_frequency_monthly.rb +1 -1
  43. data/lib/checkout_sdk/accounts/schedule_frequency_weekly.rb +1 -1
  44. data/lib/checkout_sdk/accounts/shareholder_structure.rb +14 -0
  45. data/lib/checkout_sdk/accounts/shareholder_structure_type.rb +9 -0
  46. data/lib/checkout_sdk/accounts/submitter.rb +13 -0
  47. data/lib/checkout_sdk/agentic_commerce/agentic_commerce.rb +8 -0
  48. data/lib/checkout_sdk/agentic_commerce/agentic_commerce_client.rb +31 -0
  49. data/lib/checkout_sdk/agentic_commerce/delegated_payment_allowance.rb +28 -0
  50. data/lib/checkout_sdk/agentic_commerce/delegated_payment_billing_address.rb +33 -0
  51. data/lib/checkout_sdk/agentic_commerce/delegated_payment_method_card.rb +64 -0
  52. data/lib/checkout_sdk/agentic_commerce/delegated_payment_request.rb +25 -0
  53. data/lib/checkout_sdk/agentic_commerce/delegated_payment_risk_signal.rb +20 -0
  54. data/lib/checkout_sdk/api_client.rb +81 -62
  55. data/lib/checkout_sdk/apm/ideal/ideal_client.rb +1 -1
  56. data/lib/checkout_sdk/apm/previous/klarna/klarna_client.rb +1 -1
  57. data/lib/checkout_sdk/apm/previous/sepa/sepa_client.rb +1 -1
  58. data/lib/checkout_sdk/balances/balance_values.rb +28 -0
  59. data/lib/checkout_sdk/balances/balances.rb +4 -0
  60. data/lib/checkout_sdk/balances/balances_query.rb +32 -0
  61. data/lib/checkout_sdk/balances/collateral_breakdown.rb +16 -0
  62. data/lib/checkout_sdk/balances/currency_account_balance.rb +26 -0
  63. data/lib/checkout_sdk/checkout_api.rb +75 -1
  64. data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +12 -1
  65. data/lib/checkout_sdk/client.rb +2 -3
  66. data/lib/checkout_sdk/common/account_change_indicator_type.rb +12 -0
  67. data/lib/checkout_sdk/common/account_holder.rb +12 -9
  68. data/lib/checkout_sdk/common/account_password_change_indicator_type.rb +13 -0
  69. data/lib/checkout_sdk/common/account_type_card_product_type.rb +11 -0
  70. data/lib/checkout_sdk/common/cardholder_account_age_indicator_type.rb +13 -0
  71. data/lib/checkout_sdk/common/common.rb +7 -0
  72. data/lib/checkout_sdk/common/customer_retry.rb +11 -0
  73. data/lib/checkout_sdk/common/destination.rb +38 -0
  74. data/lib/checkout_sdk/common/headers.rb +16 -0
  75. data/lib/checkout_sdk/common/payment_source_type.rb +9 -0
  76. data/lib/checkout_sdk/common/product.rb +4 -1
  77. data/lib/checkout_sdk/compliance_requests/compliance_request_responded_field.rb +22 -0
  78. data/lib/checkout_sdk/compliance_requests/compliance_request_responded_fields.rb +15 -0
  79. data/lib/checkout_sdk/compliance_requests/compliance_requests.rb +6 -0
  80. data/lib/checkout_sdk/compliance_requests/compliance_requests_client.rb +34 -0
  81. data/lib/checkout_sdk/compliance_requests/compliance_response_request.rb +16 -0
  82. data/lib/checkout_sdk/customers/customers_client.rb +1 -1
  83. data/lib/checkout_sdk/disputes/dispute_status.rb +1 -0
  84. data/lib/checkout_sdk/disputes/disputes_client.rb +23 -2
  85. data/lib/checkout_sdk/disputes/disputes_query_filter.rb +49 -11
  86. data/lib/checkout_sdk/environment.rb +8 -1
  87. data/lib/checkout_sdk/environment_subdomain.rb +16 -12
  88. data/lib/checkout_sdk/error.rb +24 -8
  89. data/lib/checkout_sdk/financial/financial_client.rb +1 -1
  90. data/lib/checkout_sdk/forward/create_secret_request.rb +17 -0
  91. data/lib/checkout_sdk/forward/forward.rb +5 -0
  92. data/lib/checkout_sdk/forward/forward_client.rb +52 -0
  93. data/lib/checkout_sdk/forward/update_secret_request.rb +15 -0
  94. data/lib/checkout_sdk/identities/aml_screening/aml_screening_client.rb +29 -0
  95. data/lib/checkout_sdk/identities/aml_screening/aml_search_parameters.rb +15 -0
  96. data/lib/checkout_sdk/identities/aml_screening/aml_verification_request.rb +19 -0
  97. data/lib/checkout_sdk/identities/applicants/applicants_client.rb +43 -0
  98. data/lib/checkout_sdk/identities/applicants/create_applicant_request.rb +21 -0
  99. data/lib/checkout_sdk/identities/applicants/update_applicant_request.rb +18 -0
  100. data/lib/checkout_sdk/identities/face_authentication/face_authentication_attempt_request.rb +17 -0
  101. data/lib/checkout_sdk/identities/face_authentication/face_authentication_client.rb +82 -0
  102. data/lib/checkout_sdk/identities/face_authentication/face_authentication_request.rb +21 -0
  103. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_client.rb +77 -0
  104. data/lib/checkout_sdk/identities/id_document_verification/id_document_verification_request.rb +27 -0
  105. data/lib/checkout_sdk/identities/identities.rb +27 -0
  106. data/lib/checkout_sdk/identities/identity_verification/identity_verification_attempt_request.rb +17 -0
  107. data/lib/checkout_sdk/identities/identity_verification/identity_verification_client.rb +99 -0
  108. data/lib/checkout_sdk/identities/identity_verification/identity_verification_request.rb +21 -0
  109. data/lib/checkout_sdk/identities/identity_verification/idv_client_information.rb +17 -0
  110. data/lib/checkout_sdk/identities/identity_verification/idv_declared_data.rb +15 -0
  111. data/lib/checkout_sdk/instruments/base_instruments_client.rb +9 -0
  112. data/lib/checkout_sdk/instruments/create/instrument_bank_account.rb +1 -1
  113. data/lib/checkout_sdk/instruments/create/instrument_sepa.rb +1 -1
  114. data/lib/checkout_sdk/instruments/create/instrument_token.rb +1 -1
  115. data/lib/checkout_sdk/instruments/instruments_client.rb +1 -1
  116. data/lib/checkout_sdk/instruments/previous/instruments_client.rb +1 -1
  117. data/lib/checkout_sdk/instruments/update/update_instrument_bank_account.rb +1 -1
  118. data/lib/checkout_sdk/instruments/update/update_instrument_card.rb +1 -1
  119. data/lib/checkout_sdk/instruments/update/update_instrument_token.rb +1 -1
  120. data/lib/checkout_sdk/issuing/add_control_group_request.rb +19 -0
  121. data/lib/checkout_sdk/issuing/add_control_profile_request.rb +13 -0
  122. data/lib/checkout_sdk/issuing/amend_dispute_request.rb +31 -0
  123. data/lib/checkout_sdk/issuing/cardholder_access_token_request.rb +26 -0
  124. data/lib/checkout_sdk/issuing/create_dispute_request.rb +27 -0
  125. data/lib/checkout_sdk/issuing/escalate_dispute_request.rb +23 -0
  126. data/lib/checkout_sdk/issuing/issuing.rb +27 -0
  127. data/lib/checkout_sdk/issuing/issuing_address.rb +25 -0
  128. data/lib/checkout_sdk/issuing/issuing_client.rb +274 -14
  129. data/lib/checkout_sdk/issuing/issuing_dispute_fraud_details.rb +18 -0
  130. data/lib/checkout_sdk/issuing/issuing_dispute_fraud_type.rb +21 -0
  131. data/lib/checkout_sdk/issuing/issuing_phone_number.rb +16 -0
  132. data/lib/checkout_sdk/issuing/oob_authentication_request.rb +15 -0
  133. data/lib/checkout_sdk/issuing/oob_simulate_transaction_details.rb +19 -0
  134. data/lib/checkout_sdk/issuing/simulate_refund_request.rb +13 -0
  135. data/lib/checkout_sdk/issuing/submit_dispute_request.rb +21 -0
  136. data/lib/checkout_sdk/issuing/update_card_request.rb +27 -0
  137. data/lib/checkout_sdk/issuing/update_cardholder_request.rb +29 -0
  138. data/lib/checkout_sdk/issuing/update_control_profile_request.rb +13 -0
  139. data/lib/checkout_sdk/metadata/metadata_client.rb +1 -1
  140. data/lib/checkout_sdk/metadata/source/bin_metadata_source.rb +1 -1
  141. data/lib/checkout_sdk/metadata/source/card_metadata_source.rb +1 -1
  142. data/lib/checkout_sdk/metadata/source/id_metadata_source.rb +1 -1
  143. data/lib/checkout_sdk/metadata/source/token_metadata_source.rb +1 -1
  144. data/lib/checkout_sdk/network_tokens/network_token_cryptogram_request.rb +13 -0
  145. data/lib/checkout_sdk/network_tokens/network_token_source_card.rb +25 -0
  146. data/lib/checkout_sdk/network_tokens/network_token_source_id.rb +19 -0
  147. data/lib/checkout_sdk/network_tokens/network_tokens.rb +7 -0
  148. data/lib/checkout_sdk/network_tokens/network_tokens_client.rb +51 -0
  149. data/lib/checkout_sdk/network_tokens/provision_network_token_request.rb +14 -0
  150. data/lib/checkout_sdk/oauth_access_token.rb +6 -1
  151. data/lib/checkout_sdk/oauth_scopes.rb +4 -0
  152. data/lib/checkout_sdk/oauth_sdk_credentials.rb +2 -1
  153. data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator.rb +6 -0
  154. data/lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb +72 -0
  155. data/lib/checkout_sdk/onboarding_simulator/simulator_entity_status.rb +16 -0
  156. data/lib/checkout_sdk/onboarding_simulator/simulator_set_requirements_due_request.rb +14 -0
  157. data/lib/checkout_sdk/onboarding_simulator/simulator_set_status_request.rb +13 -0
  158. data/lib/checkout_sdk/payment_methods/payment_methods.rb +4 -0
  159. data/lib/checkout_sdk/payment_methods/payment_methods_client.rb +24 -0
  160. data/lib/checkout_sdk/payment_methods/payment_methods_query.rb +13 -0
  161. data/lib/checkout_sdk/payments/apple_pay/apple_pay_certificate_request.rb +13 -0
  162. data/lib/checkout_sdk/payments/apple_pay/apple_pay_client.rb +44 -0
  163. data/lib/checkout_sdk/payments/apple_pay/apple_pay_enrollment_request.rb +13 -0
  164. data/lib/checkout_sdk/payments/apple_pay/apple_pay_signing_request.rb +13 -0
  165. data/lib/checkout_sdk/payments/applepay.rb +14 -0
  166. data/lib/checkout_sdk/payments/base_payments_client.rb +19 -0
  167. data/lib/checkout_sdk/payments/cancellation_request.rb +13 -0
  168. data/lib/checkout_sdk/payments/{sessions/card.rb → card.rb} +4 -1
  169. data/lib/checkout_sdk/payments/contexts/payment_contexts_client.rb +1 -1
  170. data/lib/checkout_sdk/payments/destination/bank_account_destination.rb +1 -1
  171. data/lib/checkout_sdk/payments/destination/card_destination.rb +1 -1
  172. data/lib/checkout_sdk/payments/destination/id_destination.rb +1 -1
  173. data/lib/checkout_sdk/payments/destination/token_destination.rb +1 -1
  174. data/lib/checkout_sdk/payments/exemption.rb +2 -0
  175. data/lib/checkout_sdk/payments/flow/flow_client.rb +59 -0
  176. data/lib/checkout_sdk/payments/google_pay/google_pay_client.rb +48 -0
  177. data/lib/checkout_sdk/payments/google_pay/google_pay_domain_request.rb +13 -0
  178. data/lib/checkout_sdk/payments/google_pay/google_pay_enrollment_request.rb +17 -0
  179. data/lib/checkout_sdk/payments/googlepay.rb +14 -0
  180. data/lib/checkout_sdk/payments/hosted/hosted_payment_instruction.rb +11 -0
  181. data/lib/checkout_sdk/payments/hosted/hosted_payments_client.rb +1 -1
  182. data/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +51 -23
  183. data/lib/checkout_sdk/payments/hosted/payment_purpose_type.rb +27 -0
  184. data/lib/checkout_sdk/payments/links/payment_link.rb +26 -1
  185. data/lib/checkout_sdk/payments/links/payments_links_client.rb +1 -1
  186. data/lib/checkout_sdk/payments/locale_type.rb +31 -0
  187. data/lib/checkout_sdk/payments/partial_authorization.rb +11 -0
  188. data/lib/checkout_sdk/payments/passenger.rb +20 -6
  189. data/lib/checkout_sdk/payments/payment_method_configuration.rb +17 -0
  190. data/lib/checkout_sdk/payments/payment_plan.rb +43 -0
  191. data/lib/checkout_sdk/payments/payment_request.rb +5 -1
  192. data/lib/checkout_sdk/payments/payments.rb +48 -4
  193. data/lib/checkout_sdk/payments/payments_client.rb +1 -1
  194. data/lib/checkout_sdk/payments/payments_search_request.rb +20 -0
  195. data/lib/checkout_sdk/payments/previous/destination/card_destination.rb +1 -1
  196. data/lib/checkout_sdk/payments/previous/destination/id_destination.rb +1 -1
  197. data/lib/checkout_sdk/payments/previous/destination/token_destination.rb +1 -1
  198. data/lib/checkout_sdk/payments/previous/payments_client.rb +1 -1
  199. data/lib/checkout_sdk/payments/previous/source/apm/alipay_source.rb +1 -1
  200. data/lib/checkout_sdk/payments/previous/source/apm/alma_source.rb +1 -1
  201. data/lib/checkout_sdk/payments/previous/source/apm/bancontact_source.rb +1 -1
  202. data/lib/checkout_sdk/payments/previous/source/apm/benefit_pay_source.rb +1 -1
  203. data/lib/checkout_sdk/payments/previous/source/apm/boleto_source.rb +1 -1
  204. data/lib/checkout_sdk/payments/previous/source/apm/eps_source.rb +1 -1
  205. data/lib/checkout_sdk/payments/previous/source/apm/fawry_source.rb +1 -1
  206. data/lib/checkout_sdk/payments/previous/source/apm/giropay_source.rb +1 -1
  207. data/lib/checkout_sdk/payments/previous/source/apm/ideal_source.rb +1 -1
  208. data/lib/checkout_sdk/payments/previous/source/apm/klarna_source.rb +1 -1
  209. data/lib/checkout_sdk/payments/previous/source/apm/knet_source.rb +1 -1
  210. data/lib/checkout_sdk/payments/previous/source/apm/multi_banco_source.rb +1 -1
  211. data/lib/checkout_sdk/payments/previous/source/apm/oxxo_source.rb +1 -1
  212. data/lib/checkout_sdk/payments/previous/source/apm/p24_source.rb +1 -1
  213. data/lib/checkout_sdk/payments/previous/source/apm/pago_facil_source.rb +1 -1
  214. data/lib/checkout_sdk/payments/previous/source/apm/paypal_source.rb +1 -1
  215. data/lib/checkout_sdk/payments/previous/source/apm/poli_source.rb +1 -1
  216. data/lib/checkout_sdk/payments/previous/source/apm/qpay_source.rb +1 -1
  217. data/lib/checkout_sdk/payments/previous/source/apm/rapi_pago_source.rb +1 -1
  218. data/lib/checkout_sdk/payments/previous/source/apm/sofort_source.rb +1 -1
  219. data/lib/checkout_sdk/payments/previous/source/card_source.rb +1 -1
  220. data/lib/checkout_sdk/payments/previous/source/customer_source.rb +1 -1
  221. data/lib/checkout_sdk/payments/previous/source/d_local_source.rb +1 -1
  222. data/lib/checkout_sdk/payments/previous/source/id_source.rb +1 -1
  223. data/lib/checkout_sdk/payments/previous/source/network_token_source.rb +1 -1
  224. data/lib/checkout_sdk/payments/previous/source/token_source.rb +1 -1
  225. data/lib/checkout_sdk/payments/processing_data.rb +45 -0
  226. data/lib/checkout_sdk/payments/processing_settings.rb +14 -1
  227. data/lib/checkout_sdk/payments/product.rb +14 -1
  228. data/lib/checkout_sdk/payments/product_item_type.rb +11 -0
  229. data/lib/checkout_sdk/payments/product_sub_type.rb +13 -0
  230. data/lib/checkout_sdk/payments/refund_order.rb +53 -0
  231. data/lib/checkout_sdk/payments/refund_request.rb +11 -2
  232. data/lib/checkout_sdk/payments/sender/corporate_sender.rb +1 -1
  233. data/lib/checkout_sdk/payments/sender/government_sender.rb +4 -1
  234. data/lib/checkout_sdk/payments/sender/individual_sender.rb +4 -1
  235. data/lib/checkout_sdk/payments/sender/instrument_sender.rb +1 -1
  236. data/lib/checkout_sdk/payments/sessions/payment_sessions_client.rb +13 -1
  237. data/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb +11 -1
  238. data/lib/checkout_sdk/payments/sessions/store_payment_details_type.rb +1 -0
  239. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification.rb +17 -0
  240. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification_type.rb +15 -0
  241. data/lib/checkout_sdk/payments/setups/account_funding_transaction_purpose.rb +29 -0
  242. data/lib/checkout_sdk/payments/setups/account_funding_transaction_recipient.rb +26 -0
  243. data/lib/checkout_sdk/payments/setups/account_funding_transaction_sender.rb +29 -0
  244. data/lib/checkout_sdk/payments/setups/bacs_payment_method.rb +41 -0
  245. data/lib/checkout_sdk/payments/setups/blik_payment_method.rb +20 -0
  246. data/lib/checkout_sdk/payments/setups/card_present_payment_method.rb +35 -0
  247. data/lib/checkout_sdk/payments/setups/pay_by_bank_payment_method.rb +24 -0
  248. data/lib/checkout_sdk/payments/setups/payment_setup_account_funding_transaction.rb +20 -0
  249. data/lib/checkout_sdk/payments/setups/payment_setups_client.rb +75 -0
  250. data/lib/checkout_sdk/payments/setups/stablecoin_payment_method.rb +16 -0
  251. data/lib/checkout_sdk/payments/source/apm/ach_source.rb +27 -0
  252. data/lib/checkout_sdk/payments/source/apm/after_pay_source.rb +1 -1
  253. data/lib/checkout_sdk/payments/source/apm/alma_source.rb +1 -1
  254. data/lib/checkout_sdk/payments/source/apm/bancontact_source.rb +1 -1
  255. data/lib/checkout_sdk/payments/source/apm/benefit_source.rb +1 -1
  256. data/lib/checkout_sdk/payments/source/apm/bizum_source.rb +15 -0
  257. data/lib/checkout_sdk/payments/source/apm/blik_source.rb +31 -0
  258. data/lib/checkout_sdk/payments/source/apm/cv_connect_source.rb +1 -1
  259. data/lib/checkout_sdk/payments/source/apm/eps_source.rb +1 -1
  260. data/lib/checkout_sdk/payments/source/apm/fawry_source.rb +1 -1
  261. data/lib/checkout_sdk/payments/source/apm/giropay_source.rb +1 -1
  262. data/lib/checkout_sdk/payments/source/apm/ideal_source.rb +1 -1
  263. data/lib/checkout_sdk/payments/source/apm/illicado_source.rb +1 -1
  264. data/lib/checkout_sdk/payments/source/apm/klarna_source.rb +1 -1
  265. data/lib/checkout_sdk/payments/source/apm/knet_source.rb +1 -1
  266. data/lib/checkout_sdk/payments/source/apm/mbway_source.rb +1 -1
  267. data/lib/checkout_sdk/payments/source/apm/multi_banco_source.rb +1 -1
  268. data/lib/checkout_sdk/payments/source/apm/octopus_source.rb +11 -0
  269. data/lib/checkout_sdk/payments/source/apm/p24_source.rb +1 -1
  270. data/lib/checkout_sdk/payments/source/apm/paypal_source.rb +1 -1
  271. data/lib/checkout_sdk/payments/source/apm/plaid_source.rb +17 -0
  272. data/lib/checkout_sdk/payments/source/apm/post_finance_source.rb +1 -1
  273. data/lib/checkout_sdk/payments/source/apm/qpay_source.rb +1 -1
  274. data/lib/checkout_sdk/payments/source/apm/sepa_source.rb +1 -1
  275. data/lib/checkout_sdk/payments/source/apm/sequra_source.rb +15 -0
  276. data/lib/checkout_sdk/payments/source/apm/sofort_source.rb +1 -1
  277. data/lib/checkout_sdk/payments/source/apm/stcpay_source.rb +1 -1
  278. data/lib/checkout_sdk/payments/source/apm/tamara_source.rb +1 -1
  279. data/lib/checkout_sdk/payments/source/apm/trustly_source.rb +1 -1
  280. data/lib/checkout_sdk/payments/source/apm/we_chat_pay_source.rb +1 -1
  281. data/lib/checkout_sdk/payments/source/bank_account_source.rb +1 -1
  282. data/lib/checkout_sdk/payments/source/card_source.rb +5 -2
  283. data/lib/checkout_sdk/payments/source/currency_account_source.rb +1 -1
  284. data/lib/checkout_sdk/payments/source/customer_source.rb +5 -2
  285. data/lib/checkout_sdk/payments/source/entity_source.rb +1 -1
  286. data/lib/checkout_sdk/payments/source/id_source.rb +5 -2
  287. data/lib/checkout_sdk/payments/source/network_token_source.rb +8 -2
  288. data/lib/checkout_sdk/payments/source/provider_token_source.rb +1 -1
  289. data/lib/checkout_sdk/payments/source/token_source.rb +5 -2
  290. data/lib/checkout_sdk/reports/reports_client.rb +1 -1
  291. data/lib/checkout_sdk/risk/source/card_source.rb +1 -1
  292. data/lib/checkout_sdk/risk/source/customer_source.rb +1 -1
  293. data/lib/checkout_sdk/risk/source/id_source.rb +1 -1
  294. data/lib/checkout_sdk/risk/source/token_source.rb +1 -1
  295. data/lib/checkout_sdk/sessions/authentication_method.rb +3 -3
  296. data/lib/checkout_sdk/sessions/authentication_type.rb +3 -3
  297. data/lib/checkout_sdk/sessions/card_holder_account_info.rb +39 -3
  298. data/lib/checkout_sdk/sessions/channel/app_session.rb +1 -1
  299. data/lib/checkout_sdk/sessions/channel/browser_session.rb +5 -2
  300. data/lib/checkout_sdk/sessions/channel/channel_data_type.rb +1 -0
  301. data/lib/checkout_sdk/sessions/channel/merchant_initiated_session.rb +15 -0
  302. data/lib/checkout_sdk/sessions/channel/request_type.rb +19 -0
  303. data/lib/checkout_sdk/sessions/channel/sdk_interface_type.rb +2 -2
  304. data/lib/checkout_sdk/sessions/completion/hosted_completion_info.rb +1 -1
  305. data/lib/checkout_sdk/sessions/completion/non_hosted_completion_info.rb +1 -1
  306. data/lib/checkout_sdk/sessions/device_information.rb +17 -0
  307. data/lib/checkout_sdk/sessions/initial_transaction.rb +23 -0
  308. data/lib/checkout_sdk/sessions/installment.rb +5 -0
  309. data/lib/checkout_sdk/sessions/merchant_risk_info.rb +20 -2
  310. data/lib/checkout_sdk/sessions/optimization.rb +19 -0
  311. data/lib/checkout_sdk/sessions/optimized_properties.rb +17 -0
  312. data/lib/checkout_sdk/sessions/pre_order_purchase_indicator_type.rb +10 -0
  313. data/lib/checkout_sdk/sessions/recurring.rb +5 -0
  314. data/lib/checkout_sdk/sessions/reorder_items_indicator_type.rb +10 -0
  315. data/lib/checkout_sdk/sessions/session_request.rb +26 -2
  316. data/lib/checkout_sdk/sessions/sessions.rb +10 -0
  317. data/lib/checkout_sdk/sessions/sessions_client.rb +2 -2
  318. data/lib/checkout_sdk/sessions/source/card_source.rb +3 -2
  319. data/lib/checkout_sdk/sessions/source/id_source.rb +1 -1
  320. data/lib/checkout_sdk/sessions/source/network_token_source.rb +1 -1
  321. data/lib/checkout_sdk/sessions/source/token_source.rb +1 -1
  322. data/lib/checkout_sdk/sessions/three_ds_method_completion_request.rb +3 -1
  323. data/lib/checkout_sdk/sessions/three_ds_req_auth_method.rb +16 -0
  324. data/lib/checkout_sdk/sessions/three_ds_requestor_authentication_info.rb +17 -0
  325. data/lib/checkout_sdk/sessions/transaction_type.rb +3 -3
  326. data/lib/checkout_sdk/sources/sepa_source_request.rb +1 -1
  327. data/lib/checkout_sdk/sources/sources_client.rb +1 -1
  328. data/lib/checkout_sdk/standalone_account_updater/account_updater_card.rb +17 -0
  329. data/lib/checkout_sdk/standalone_account_updater/account_updater_instrument.rb +13 -0
  330. data/lib/checkout_sdk/standalone_account_updater/account_updater_request.rb +13 -0
  331. data/lib/checkout_sdk/standalone_account_updater/account_updater_source_options.rb +15 -0
  332. data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater.rb +7 -0
  333. data/lib/checkout_sdk/standalone_account_updater/standalone_account_updater_client.rb +29 -0
  334. data/lib/checkout_sdk/tokens/apple_pay_token_request.rb +1 -1
  335. data/lib/checkout_sdk/tokens/google_pay_token_request.rb +1 -1
  336. data/lib/checkout_sdk/tokens/token_metadata_billing_address.rb +16 -0
  337. data/lib/checkout_sdk/tokens/token_metadata_response.rb +55 -0
  338. data/lib/checkout_sdk/tokens/tokens.rb +2 -0
  339. data/lib/checkout_sdk/tokens/tokens_client.rb +11 -0
  340. data/lib/checkout_sdk/transfers/create_transfer.rb +5 -5
  341. data/lib/checkout_sdk/transfers/transfer_source.rb +4 -1
  342. data/lib/checkout_sdk/transfers/transfers_client.rb +2 -2
  343. data/lib/checkout_sdk/version.rb +1 -1
  344. data/lib/checkout_sdk/workflows/entity_workflow_condition.rb +1 -1
  345. data/lib/checkout_sdk/workflows/event_workflow_condition.rb +1 -1
  346. data/lib/checkout_sdk/workflows/processing_channel_workflow_condition.rb +1 -1
  347. data/lib/checkout_sdk/workflows/webhook_workflow_action.rb +1 -1
  348. data/lib/checkout_sdk/workflows/workflows_client.rb +1 -1
  349. data/lib/checkout_sdk.rb +8 -0
  350. metadata +194 -19
  351. data/lib/checkout_sdk/payments/passenger_name.rb +0 -11
  352. data/lib/checkout_sdk/payments/sessions/payment_method_configuration.rb +0 -11
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'csv'
4
+
3
5
  module CheckoutSdk
4
6
  class ApiClient
5
7
  attr_accessor :client, :multipart_client, :log
6
8
 
7
- # @param [CheckoutConfiguration] configuration
8
- # @param [String] uri
9
9
  def initialize(configuration, uri)
10
10
  @client = configuration.http_client.clone
11
11
  @client.url_prefix = uri
@@ -14,54 +14,41 @@ module CheckoutSdk
14
14
  @log = configuration.logger
15
15
  end
16
16
 
17
- # @param [String] path
18
- # @param [SdkAuthorization] authorization
19
- # @param [Object] params
20
- def invoke_get(path,
21
- authorization,
22
- params = nil)
17
+ def invoke_get(path, authorization, params = nil)
23
18
  invoke(:get, path, authorization, params: params)
24
19
  end
25
20
 
26
- def invoke_post(path,
27
- authorization,
28
- request = nil,
29
- idempotency_key = nil)
30
- invoke(:post, path, authorization, request, idempotency_key)
21
+ def invoke_post(path, authorization, request = nil, idempotency_key = nil)
22
+ invoke(:post, path, authorization, request, idempotency_key, params: nil)
31
23
  end
32
24
 
33
- def invoke_put(path,
34
- authorization,
35
- request)
36
- invoke(:put, path, authorization, request)
25
+ def invoke_put(path, authorization, request, headers = nil)
26
+ invoke(:put, path, authorization, request, nil, params: nil, extra_headers: headers)
37
27
  end
38
28
 
39
- def invoke_patch(path,
40
- authorization,
41
- request = nil)
42
- invoke(:patch, path, authorization, request)
29
+ def invoke_patch(path, authorization, request = nil)
30
+ invoke(:patch, path, authorization, request, nil, params: nil)
43
31
  end
44
32
 
45
- def invoke_delete(path,
46
- authorization)
33
+ def invoke_delete(path, authorization)
47
34
  invoke(:delete, path, authorization)
48
35
  end
49
36
 
50
- def submit_file(path,
51
- authorization,
52
- request)
37
+ def submit_file(path, authorization, request)
53
38
  upload(path, authorization, request)
54
39
  end
55
40
 
56
41
  private
57
42
 
58
- 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)
59
44
  path = append_params(path, params) unless params.nil?
60
45
 
61
- headers = get_default_headers authorization
46
+ headers = default_headers(authorization)
62
47
  headers[:'Content-Type'] = 'application/json'
63
48
  headers[:'Cko-Idempotency-Key'] = idempotency_key unless idempotency_key.nil?
64
49
 
50
+ apply_extra_headers(headers, extra_headers)
51
+
65
52
  json_body = CheckoutSdk::JsonSerializer.to_custom_hash(body).to_json
66
53
 
67
54
  begin
@@ -71,26 +58,33 @@ module CheckoutSdk
71
58
  raise CheckoutApiException, e.response
72
59
  end
73
60
 
74
- parse_response response
61
+ parse_response(response)
75
62
  end
76
63
 
77
- def get_default_headers(authorization)
78
- {
79
- 'User-Agent': "checkout-sdk-ruby/#{VERSION}",
80
- Accept: 'application/json',
81
- Authorization: authorization.authorization_header
82
- }
64
+ def default_headers(authorization)
65
+ { 'User-Agent': "checkout-sdk-ruby/#{VERSION}", Accept: 'application/json',
66
+ Authorization: authorization.authorization_header }
67
+ end
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
83
77
  end
84
78
 
85
79
  def append_params(path, input_params)
86
80
  raise CheckoutArgumentException, 'Query parameters were not provided' if input_params.nil?
87
81
 
88
- if input_params.is_a? String
89
- params = input_params
90
- else
91
- hash = CheckoutSdk::JsonSerializer.to_custom_hash(input_params)
92
- params = URI.encode_www_form(hash)
93
- end
82
+ params = if input_params.is_a? String
83
+ input_params
84
+ else
85
+ hash = CheckoutSdk::JsonSerializer.to_custom_hash(input_params)
86
+ URI.encode_www_form(hash)
87
+ end
94
88
 
95
89
  "#{path}?#{params}"
96
90
  end
@@ -103,48 +97,73 @@ module CheckoutSdk
103
97
  MIME::Types.type_for(file_request.file).first,
104
98
  File.basename(file_request.file)
105
99
  ),
106
- :purpose => file_request.purpose
100
+ purpose: file_request.purpose
107
101
  }
108
102
  end
109
103
 
110
104
  def upload(path, authorization, file_request)
111
- headers = get_default_headers authorization
105
+ headers = default_headers(authorization)
112
106
 
113
- file = File.open(file_request.file)
107
+ File.open(file_request.file) do |file|
108
+ form = build_multipart_request(file_request, file)
114
109
 
115
- form = build_multipart_request file_request, file
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
116
116
 
117
- begin
118
- @log.info "post: /#{path}"
119
- response = @multipart_client.run_request(:post, path, form, headers)
120
- rescue Faraday::ClientError => e
121
- raise CheckoutApiException, e.response
122
- ensure
123
- file.close
117
+ parse_response(response)
124
118
  end
125
-
126
- parse_response response
127
119
  end
128
120
 
129
121
  def parse_response(response)
130
122
  raise CheckoutApiException, response if response.status < 200 || response.status >= 400
131
123
 
132
124
  metadata = CheckoutUtils.map_to_http_metadata(response)
133
- body = parse_json_or_contents(response)
134
- body = OpenStruct.new if body.nil?
135
- body = OpenStruct.new(items: body) if body.is_a? Array
136
- body.http_metadata = metadata if body.is_a? OpenStruct
125
+ body = parse_body(response)
126
+
127
+ if body.is_a?(Array)
128
+ body = OpenStruct.new(items: body)
129
+ elsif !body.is_a?(OpenStruct)
130
+ body = OpenStruct.new(contents: body)
131
+ end
132
+
133
+ body.http_metadata = metadata if body.is_a?(OpenStruct)
134
+
137
135
  body
136
+ rescue JSON::ParserError => e
137
+ raise CheckoutApiException.new(response, "Error parsing JSON: #{e.message}")
138
+ rescue StandardError => e
139
+ @log&.error("Unexpected error occurred: #{e.message}")
140
+ raise
138
141
  end
139
142
 
140
- def parse_json_or_contents(response)
141
- return if response.body.nil? || response.body == ''
143
+ def parse_body(response)
144
+ content_type = response.headers['Content-Type']
145
+ return OpenStruct.new if response.body.nil? || response.body.empty?
142
146
 
143
- if response.body.start_with?('{', '[')
144
- JSON.parse(response.body, object_class: OpenStruct)
147
+ if content_type&.include?('application/json')
148
+ parsed_value = JSON.parse(response.body)
149
+ deep_convert_to_ostruct(parsed_value)
150
+ elsif content_type&.include?('text/csv')
151
+ csv_data = CSV.parse(response.body, headers: true)
152
+ OpenStruct.new(csv: csv_data)
145
153
  else
146
154
  OpenStruct.new(contents: response.body)
147
155
  end
148
156
  end
157
+
158
+ def deep_convert_to_ostruct(obj)
159
+ case obj
160
+ when Hash
161
+ OpenStruct.new(obj.transform_values { |value| deep_convert_to_ostruct(value) })
162
+ when Array
163
+ obj.map { |item| deep_convert_to_ostruct(item) }
164
+ else
165
+ obj
166
+ end
167
+ end
149
168
  end
150
169
  end
@@ -10,7 +10,7 @@ module CheckoutSdk
10
10
  # @param [ApiClient] api_client
11
11
  # @param [CheckoutConfiguration] configuration
12
12
  def initialize(api_client, configuration)
13
- super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
13
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
14
14
  end
15
15
 
16
16
  def info
@@ -13,7 +13,7 @@ module CheckoutSdk
13
13
  # @param [ApiClient] api_client
14
14
  # @param [CheckoutConfiguration] configuration
15
15
  def initialize(api_client, configuration)
16
- super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
16
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
17
17
  end
18
18
 
19
19
  # @param credit_session_request [Hash, CreditSessionRequest]
@@ -13,7 +13,7 @@ module CheckoutSdk
13
13
  # @param [ApiClient] api_client
14
14
  # @param [CheckoutConfiguration] configuration
15
15
  def initialize(api_client, configuration)
16
- super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
16
+ super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
17
17
  end
18
18
 
19
19
  # @param mandate_id [String]
@@ -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
@@ -43,6 +43,38 @@ module CheckoutSdk
43
43
  # @return [CheckoutSdk::Payments::PaymentContextsClient]
44
44
  # @!attribute payment_sessions
45
45
  # @return [CheckoutSdk::Payments::PaymentSessionsClient]
46
+ # @!attribute payments_setups
47
+ # @return [CheckoutSdk::Payments::PaymentSetupsClient]
48
+ # @!attribute flow
49
+ # @return [CheckoutSdk::Payments::FlowClient]
50
+ # @!attribute forward
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]
46
78
  class CheckoutApi
47
79
  attr_reader :customers,
48
80
  :disputes,
@@ -51,6 +83,8 @@ module CheckoutSdk
51
83
  :instruments,
52
84
  :links,
53
85
  :payments,
86
+ :payments_setups,
87
+ :flow,
54
88
  :reports,
55
89
  :sessions,
56
90
  :tokens,
@@ -64,7 +98,21 @@ module CheckoutSdk
64
98
  :financial,
65
99
  :issuing,
66
100
  :contexts,
67
- :payment_sessions
101
+ :payment_sessions,
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
68
116
 
69
117
  # @param [CheckoutConfiguration] configuration
70
118
  def initialize(configuration)
@@ -90,6 +138,26 @@ module CheckoutSdk
90
138
  @issuing = CheckoutSdk::Issuing::IssuingClient.new api_client, configuration
91
139
  @contexts = CheckoutSdk::Payments::PaymentContextsClient.new api_client, configuration
92
140
  @payment_sessions = CheckoutSdk::Payments::PaymentSessionsClient.new api_client, configuration
141
+ @payments_setups = CheckoutSdk::Payments::PaymentSetupsClient.new api_client, configuration
142
+ @flow = CheckoutSdk::Payments::FlowClient.new api_client, configuration
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)
93
161
  end
94
162
 
95
163
  private
@@ -122,5 +190,11 @@ module CheckoutSdk
122
190
  def transfers_client(configuration)
123
191
  ApiClient.new(configuration, configuration.environment.transfers_uri)
124
192
  end
193
+
194
+ # @param [CheckoutConfiguration] configuration
195
+ # @return [ApiClient]
196
+ def forward_client(configuration)
197
+ ApiClient.new(configuration, configuration.environment.forward_uri)
198
+ end
125
199
  end
126
200
  end
@@ -41,6 +41,17 @@ module CheckoutSdk
41
41
  # @return [CheckoutSdk::CheckoutApi]
42
42
  def build
43
43
  super
44
+
45
+ # Determine authorization URI following Go logic
46
+ auth_uri = authorization_uri
47
+ if auth_uri.nil? || auth_uri.empty?
48
+ auth_uri = if environment_subdomain
49
+ environment_subdomain.authorization_uri
50
+ else
51
+ environment.authorization_uri
52
+ end
53
+ end
54
+
44
55
  configuration = CheckoutConfiguration.new(
45
56
  OAuthSdkCredentials.new(client_id,
46
57
  client_secret,
@@ -48,7 +59,7 @@ module CheckoutSdk
48
59
  http_client,
49
60
  environment,
50
61
  logger,
51
- authorization_uri),
62
+ auth_uri),
52
63
  environment,
53
64
  http_client,
54
65
  multipart_http_client,
@@ -11,7 +11,8 @@ module CheckoutSdk
11
11
  attr_reader :api_client,
12
12
  :authorization_type,
13
13
  :configuration
14
- protected :api_client, :authorization_type, :configuration
14
+
15
+ protected
15
16
 
16
17
  # @param [CheckoutSdk::ApiClient] api_client
17
18
  # @param [CheckoutConfiguration] configuration
@@ -22,8 +23,6 @@ module CheckoutSdk
22
23
  @configuration = configuration
23
24
  end
24
25
 
25
- protected
26
-
27
26
  # @param [Array] args
28
27
  def build_path(*args)
29
28
  args.join('/')
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountChangeIndicatorType
6
+ THIS_TRANSACTION = 'this_transaction'
7
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
8
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
9
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
10
+ end
11
+ end
12
+ end
@@ -4,7 +4,7 @@ module CheckoutSdk
4
4
  module Common
5
5
  # @!attribute type
6
6
  # @return [String] {AccountHolderType}
7
- # @!attribute title
7
+ # @!attribute full_name
8
8
  # @return [String]
9
9
  # @!attribute first_name
10
10
  # @return [String]
@@ -12,6 +12,10 @@ module CheckoutSdk
12
12
  # @return [String]
13
13
  # @!attribute last_name
14
14
  # @return [String]
15
+ # @!attribute email
16
+ # @return [String]
17
+ # @!attribute gender
18
+ # @return [String]
15
19
  # @!attribute company_name
16
20
  # @return [String]
17
21
  # @!attribute tax_id
@@ -21,23 +25,23 @@ module CheckoutSdk
21
25
  # @!attribute country_of_birth
22
26
  # @return [Country]
23
27
  # @!attribute residential_status
24
- # @return [String]
28
+ # @return [String] {ResidentialStatusType}
25
29
  # @!attribute billing_address
26
30
  # @return [Address]
27
31
  # @!attribute phone
28
32
  # @return [Phone]
29
33
  # @!attribute identification
30
34
  # @return [AccountHolderIdentification]
31
- # @!attribute email
32
- # @return [String]
33
- # @!attribute gender
34
- # @return [String]
35
+ # @!attribute account_name_inquiry
36
+ # @return [Boolean]
35
37
  class AccountHolder
36
38
  attr_accessor :type,
37
- :title,
39
+ :full_name,
38
40
  :first_name,
39
41
  :middle_name,
40
42
  :last_name,
43
+ :email,
44
+ :gender,
41
45
  :company_name,
42
46
  :tax_id,
43
47
  :date_of_birth,
@@ -46,8 +50,7 @@ module CheckoutSdk
46
50
  :billing_address,
47
51
  :phone,
48
52
  :identification,
49
- :email,
50
- :gender
53
+ :account_name_inquiry
51
54
  end
52
55
  end
53
56
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountPasswordChangeIndicatorType
6
+ NO_CHANGE = 'no_change'
7
+ THIS_TRANSACTION = 'this_transaction'
8
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
9
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
10
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountTypeCardProductType
6
+ CREDIT = 'credit'
7
+ DEBIT = 'debit'
8
+ NOT_APPLICABLE = 'not_applicable'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class CardholderAccountAgeIndicatorType
6
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
7
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
8
+ NO_ACCOUNT = 'no_account'
9
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
10
+ THIS_TRANSACTION = 'this_transaction'
11
+ end
12
+ end
13
+ end
@@ -23,3 +23,10 @@ require 'checkout_sdk/common/marketplace_data'
23
23
  require 'checkout_sdk/common/shipping_info'
24
24
  require 'checkout_sdk/common/product'
25
25
  require 'checkout_sdk/common/date_range_query_filter'
26
+ require 'checkout_sdk/common/account_change_indicator_type'
27
+ require 'checkout_sdk/common/account_password_change_indicator_type'
28
+ require 'checkout_sdk/common/account_type_card_product_type'
29
+ require 'checkout_sdk/common/cardholder_account_age_indicator_type'
30
+ require 'checkout_sdk/common/customer_retry'
31
+ require 'checkout_sdk/common/destination'
32
+ require 'checkout_sdk/common/headers'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Accounts
5
+ # @!attribute max_attempts
6
+ # @return [Integer]
7
+ class CustomerRetry
8
+ attr_accessor :max_attempts
9
+ end
10
+ end
11
+ end