checkout_sdk 2.7.0 → 2.8.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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/checkout_sdk/api_client.rb +3 -2
  3. data/lib/checkout_sdk/common/account_holder.rb +78 -1
  4. data/lib/checkout_sdk/common/account_holder_identification.rb +21 -0
  5. data/lib/checkout_sdk/common/common.rb +1 -0
  6. data/lib/checkout_sdk/common/customer_retry.rb +14 -2
  7. data/lib/checkout_sdk/common/residential_status_type.rb +11 -0
  8. data/lib/checkout_sdk/issuing/card_update_headers.rb +11 -12
  9. data/lib/checkout_sdk/issuing/issuing_client.rb +20 -11
  10. data/lib/checkout_sdk/payments/card_payout_item.rb +24 -0
  11. data/lib/checkout_sdk/payments/card_payout_processing.rb +39 -0
  12. data/lib/checkout_sdk/payments/destination/bank_account_destination.rb +29 -0
  13. data/lib/checkout_sdk/payments/destination/card_destination.rb +20 -0
  14. data/lib/checkout_sdk/payments/destination/destination.rb +5 -0
  15. data/lib/checkout_sdk/payments/destination/destination_type.rb +7 -0
  16. data/lib/checkout_sdk/payments/destination/id_destination.rb +16 -0
  17. data/lib/checkout_sdk/payments/destination/network_token_destination.rb +63 -0
  18. data/lib/checkout_sdk/payments/destination/token_destination.rb +15 -0
  19. data/lib/checkout_sdk/payments/downtime_retry_request.rb +14 -0
  20. data/lib/checkout_sdk/payments/dunning_retry_request.rb +22 -0
  21. data/lib/checkout_sdk/payments/flow/flow_client.rb +0 -4
  22. data/lib/checkout_sdk/payments/hosted/hosted_payment_instruction.rb +9 -0
  23. data/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +42 -31
  24. data/lib/checkout_sdk/payments/instruction_remittance.rb +17 -0
  25. data/lib/checkout_sdk/payments/instruction_scheme.rb +5 -0
  26. data/lib/checkout_sdk/payments/links/payment_link.rb +50 -29
  27. data/lib/checkout_sdk/payments/payment_instruction.rb +48 -1
  28. data/lib/checkout_sdk/payments/payment_request.rb +1 -1
  29. data/lib/checkout_sdk/payments/payment_retry_request.rb +9 -7
  30. data/lib/checkout_sdk/payments/payment_segment.rb +11 -0
  31. data/lib/checkout_sdk/payments/payment_type.rb +4 -1
  32. data/lib/checkout_sdk/payments/payments.rb +11 -0
  33. data/lib/checkout_sdk/payments/payments_client.rb +10 -0
  34. data/lib/checkout_sdk/payments/payout_billing_descriptor.rb +10 -0
  35. data/lib/checkout_sdk/payments/payout_request.rb +59 -1
  36. data/lib/checkout_sdk/payments/sender/corporate_sender.rb +19 -0
  37. data/lib/checkout_sdk/payments/sender/government_sender.rb +21 -0
  38. data/lib/checkout_sdk/payments/sender/individual_sender.rb +46 -0
  39. data/lib/checkout_sdk/payments/sender/instrument_sender.rb +3 -0
  40. data/lib/checkout_sdk/payments/sender/sender.rb +16 -0
  41. data/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb +55 -32
  42. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification.rb +10 -1
  43. data/lib/checkout_sdk/payments/setups/account_funding_transaction_identification_type.rb +5 -4
  44. data/lib/checkout_sdk/payments/setups/account_funding_transaction_recipient.rb +29 -1
  45. data/lib/checkout_sdk/payments/setups/account_funding_transaction_sender.rb +34 -1
  46. data/lib/checkout_sdk/payments/setups/bacs_payment_method.rb +70 -33
  47. data/lib/checkout_sdk/payments/setups/blik_payment_method.rb +3 -2
  48. data/lib/checkout_sdk/payments/setups/card_present_payment_method.rb +2 -1
  49. data/lib/checkout_sdk/payments/setups/cash_app_payment_method.rb +3 -3
  50. data/lib/checkout_sdk/payments/setups/pay_by_bank_payment_method.rb +39 -15
  51. data/lib/checkout_sdk/payments/setups/payment_setup_payment_type.rb +19 -0
  52. data/lib/checkout_sdk/payments/setups/payment_setup_risk.rb +18 -0
  53. data/lib/checkout_sdk/payments/setups/payment_setups_client.rb +110 -6
  54. data/lib/checkout_sdk/payments/setups/stablecoin_payment_method.rb +2 -1
  55. data/lib/checkout_sdk/payments/source/currency_account_source.rb +8 -0
  56. data/lib/checkout_sdk/payments/source/entity_source.rb +5 -0
  57. data/lib/checkout_sdk/payments/source/payout_source.rb +12 -1
  58. data/lib/checkout_sdk/payments/unreferenced_refund_request.rb +89 -0
  59. data/lib/checkout_sdk/version.rb +1 -1
  60. metadata +12 -2
@@ -2,40 +2,77 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
- # Bacs payment method configuration on a Payment Setup. Maps swagger `Bacs`.
6
- #
7
- # @!attribute status
8
- # @return [String] (response-only) Payment method status.
9
- # @!attribute flags
10
- # @return [Array(String)] (response-only) Diagnostic flags returned by the API.
11
- # @!attribute initialization
12
- # @return [String] The initialization type for the payment method.
13
- # @!attribute instrument_id
14
- # @return [String] (response-only) The ID of the Bacs instrument used for the payment.
15
- # @!attribute account_holder
16
- # @return [Hash] The account holder details (`type`, `first_name`, `last_name`,
17
- # `company_name`, `email`).
18
- # @!attribute account_number
19
- # @return [String] The account number of the Bacs Direct Debit account.
20
- # @!attribute bank_code
21
- # @return [String] The bank code (sort code) of the Bacs Direct Debit account.
22
- # @!attribute country
23
- # @return [String] {CheckoutSdk::Common::Country}
24
- # @!attribute currency
25
- # @return [String] {CheckoutSdk::Common::Currency}
26
- # @!attribute allow_partial_match
27
- # @return [TrueClass, FalseClass] Whether to allow a partial match of the account holder details.
5
+ # The Bacs payment method's details and configuration on a Payment Setup. Maps swagger `Bacs`.
6
+ # Sent under the `payment_methods.bacs` key.
28
7
  class BacsPaymentMethod
29
- attr_accessor :status,
30
- :flags,
31
- :initialization,
32
- :instrument_id,
33
- :account_holder,
34
- :account_number,
35
- :bank_code,
36
- :country,
37
- :currency,
38
- :allow_partial_match
8
+ # The payment method status.
9
+ # [Optional]
10
+ # Read only.
11
+ # @return [String] One of {PaymentSetupPaymentMethodStatus}.
12
+ attr_accessor :status
13
+
14
+ # The list of error codes or indicators that highlight missing or invalid information.
15
+ # [Optional]
16
+ # Read only.
17
+ # @return [Array(String)]
18
+ attr_accessor :flags
19
+
20
+ # The initialization state of the payment method.
21
+ # When you create a Payment Setup, this defaults to `disabled`.
22
+ # On update the API replaces the payment methods, so send `enabled` again to keep the method enabled.
23
+ # The specification does not state this; it is the API's behaviour.
24
+ # [Optional]
25
+ # Default: disabled
26
+ # @return [String] One of {PaymentSetupPaymentMethodInitialization}.
27
+ attr_accessor :initialization
28
+
29
+ # The ID of the Bacs instrument used for the payment.
30
+ # [Optional]
31
+ # Read only.
32
+ # @return [String]
33
+ attr_accessor :instrument_id
34
+
35
+ # The account holder details.
36
+ # [Optional]
37
+ # Keys:
38
+ # - `type` (String): The type of account holder. Enum: "individual" "corporate".
39
+ # - `first_name` (String): The first name of the account holder.
40
+ # - `last_name` (String): The last name of the account holder.
41
+ # - `company_name` (String): The legal name of a registered company that holds the account.
42
+ # - `email` (String): The email address of the account holder.
43
+ # @return [Hash]
44
+ attr_accessor :account_holder
45
+
46
+ # The account number of the Bacs Direct Debit account.
47
+ # [Optional]
48
+ # Write only.
49
+ # @return [String]
50
+ attr_accessor :account_number
51
+
52
+ # The sort code of the Bacs Direct Debit account.
53
+ # [Optional]
54
+ # Write only.
55
+ # @return [String]
56
+ attr_accessor :bank_code
57
+
58
+ # The account's country, as an ISO 3166-1 alpha-2 code.
59
+ # [Optional]
60
+ # min 2 characters, max 2 characters
61
+ # @return [String] {CheckoutSdk::Common::Country}
62
+ attr_accessor :country
63
+
64
+ # The account holder's account currency.
65
+ # [Optional]
66
+ # @return [String] {CheckoutSdk::Common::Currency}
67
+ attr_accessor :currency
68
+
69
+ # Indicates whether the Bacs instrument is created when account validation returns a partial
70
+ # match. When `true`, the instrument is created on a partial match; when `false`, instrument
71
+ # creation fails on a partial match.
72
+ # [Optional]
73
+ # Default: false
74
+ # @return [TrueClass, FalseClass]
75
+ attr_accessor :allow_partial_match
39
76
  end
40
77
  end
41
78
  end
@@ -2,10 +2,11 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
- # Blik payment method configuration on a Payment Setup.
5
+ # Blik payment method configuration on a Payment Setup. Maps swagger `Blik`.
6
6
  #
7
7
  # @!attribute status
8
- # @return [String] (response-only) Payment method status (e.g. "available").
8
+ # @return [String] (response-only) Payment method status, one of
9
+ # {PaymentSetupPaymentMethodStatus} (e.g. "ready").
9
10
  # @!attribute flags
10
11
  # @return [Array(String)] (response-only) Diagnostic flags returned by the API.
11
12
  # @!attribute partner_code
@@ -5,7 +5,8 @@ module CheckoutSdk
5
5
  # Card Present payment method configuration on a Payment Setup. Maps swagger `CardPresent`.
6
6
  #
7
7
  # @!attribute status
8
- # @return [String] (response-only) Payment method status.
8
+ # @return [String] (response-only) Payment method status, one of
9
+ # {PaymentSetupPaymentMethodStatus} (e.g. "ready").
9
10
  # @!attribute flags
10
11
  # @return [Array(String)] (response-only) Diagnostic flags returned by the API.
11
12
  # @!attribute track2
@@ -18,7 +18,6 @@ module CheckoutSdk
18
18
  # The payment method status.
19
19
  # [Optional]
20
20
  # Read only.
21
- # Enum: "unavailable" "action_required" "ready" "initialization_required" "invalid"
22
21
  # @return [String] One of {PaymentSetupPaymentMethodStatus}.
23
22
  attr_accessor :status
24
23
 
@@ -30,9 +29,10 @@ module CheckoutSdk
30
29
 
31
30
  # The initialization state of the payment method.
32
31
  # When you create a Payment Setup, this defaults to `disabled`.
32
+ # On update the API replaces the payment methods, so send `enabled` again to keep the method enabled.
33
+ # The specification does not state this; it is the API's behaviour.
33
34
  # [Optional]
34
- # Default: "disabled"
35
- # Enum: "disabled" "enabled"
35
+ # Default: disabled
36
36
  # @return [String] One of {PaymentSetupPaymentMethodInitialization}.
37
37
  attr_accessor :initialization
38
38
 
@@ -2,23 +2,47 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
- # Pay by Bank (Open Banking) payment method configuration on a Payment Setup.
6
- # Maps swagger `PayByBank`.
5
+ # The Pay by Bank (Open Banking) payment method's details and configuration on a Payment Setup.
6
+ # Maps swagger `PayByBank`. Sent under the `payment_methods.paybybank` key (one lowercase word,
7
+ # not `pay_by_bank`; the API ignores `pay_by_bank` without an error).
7
8
  #
8
- # @!attribute status
9
- # @return [String] (response-only) Payment method status.
10
- # @!attribute flags
11
- # @return [Array(String)] (response-only) Diagnostic flags returned by the API.
12
- # @!attribute bank_id
13
- # @return [String] The identifier of the bank the customer has selected for the payment.
14
- # @!attribute action
15
- # @return [Hash] (response-only) The next available action for the payment method
16
- # (`type`, `banks`).
9
+ # The Payment Setup request is a Hash, and a Hash request is sent as is, so do not nest an
10
+ # instance of this class in it directly: it would not be serialized. Pass a Hash with these keys,
11
+ # or convert an instance first:
12
+ # pay_by_bank = CheckoutSdk::Payments::PayByBankPaymentMethod.new
13
+ # pay_by_bank.bank_id = 'ob-natwest'
14
+ # request[:payment_methods] = { paybybank: CheckoutSdk::JsonSerializer.to_custom_hash(pay_by_bank) }
15
+ # Responses are read with dot access, for example response.payment_methods.paybybank.action.banks.
17
16
  class PayByBankPaymentMethod
18
- attr_accessor :status,
19
- :flags,
20
- :bank_id,
21
- :action
17
+ # The payment method status.
18
+ # [Optional]
19
+ # Read only.
20
+ # Enum: "unavailable" "action_required" "ready" "initialization_required" "invalid"
21
+ # @return [String] One of {PaymentSetupPaymentMethodStatus}.
22
+ attr_accessor :status
23
+
24
+ # The list of error codes or indicators that highlight missing or invalid information.
25
+ # [Optional]
26
+ # Read only.
27
+ # @return [Array(String)]
28
+ attr_accessor :flags
29
+
30
+ # The identifier of the bank the customer has selected for the payment.
31
+ # [Optional]
32
+ # @return [String]
33
+ attr_accessor :bank_id
34
+
35
+ # The next available action for the payment method.
36
+ # [Optional]
37
+ # Read only.
38
+ # Keys:
39
+ # - `type` (String): The type of action. Enum: "select_bank".
40
+ # - `banks` (Array(Hash)): The list of banks available for the customer to select. Each item has
41
+ # `bank_id` (String, the unique identifier of the bank), `display_name` (String, the display
42
+ # name of the bank), `logo_url` (String, the URL of the bank's logo) and `available`
43
+ # (Boolean, whether the bank is currently available for selection).
44
+ # @return [Hash]
45
+ attr_accessor :action
22
46
  end
23
47
  end
24
48
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The type of payment on a Payment Setup. Maps swagger `PaymentSetup.payment_type`.
6
+ #
7
+ # The Payment Setups API declares these values in lowercase, unlike {PaymentType}, which is the
8
+ # capitalized enum of the payments API. Use this module for the :payment_type key of a Payment
9
+ # Setup request. When :payment_type is not sent, the API uses "regular".
10
+ module PaymentSetupPaymentType
11
+ REGULAR = 'regular'
12
+ RECURRING = 'recurring'
13
+ MOTO = 'moto'
14
+ INSTALLMENT = 'installment'
15
+ PAY_LATER = 'pay_later'
16
+ UNSCHEDULED = 'unscheduled'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Risk assessment settings for the Payment Setup.
6
+ # Maps the swagger `PaymentSetup.risk` object. Sent under the `risk` key.
7
+ #
8
+ # The Payment Setup request is a Hash, so pass { enabled: false } directly, or convert an
9
+ # instance first with CheckoutSdk::JsonSerializer.to_custom_hash(risk).
10
+ class PaymentSetupRisk
11
+ # Indicates whether a risk assessment should be performed.
12
+ # [Optional]
13
+ # Default: true
14
+ # @return [TrueClass, FalseClass]
15
+ attr_accessor :enabled
16
+ end
17
+ end
18
+ end
@@ -28,12 +28,56 @@ module CheckoutSdk
28
28
  # :industry {PaymentSetupIndustry} (containing :accommodation
29
29
  # {Array(PaymentSetupAccommodation)} and :airline {Array(PaymentSetupAirline)}).
30
30
  # A Hash request is sent as is, so every nested value must be a Hash too. To use one of the
31
- # typed classes above (or {CashAppPaymentMethod}), convert it first with
31
+ # typed classes above (or {CashAppPaymentMethod}, {PayByBankPaymentMethod} or
32
+ # {PaymentSetupRisk}), convert it first with
32
33
  # CheckoutSdk::JsonSerializer.to_custom_hash(object); a typed object nested directly in the
33
34
  # Hash is not serialized and is sent as "#<CheckoutSdk::...>".
35
+ # :payment_type - String, the type of payment, one of {PaymentSetupPaymentType} (lowercase,
36
+ # unlike {PaymentType}): "regular", "recurring", "moto", "installment", "pay_later" or
37
+ # "unscheduled". Default "regular". You must provide it for card payments in which the
38
+ # cardholder is not present, for example a recurring payment or a mail order/telephone order
39
+ # (MOTO) payment.
34
40
  # :payment_methods may include :cashapp (the key is the single lowercase word `cashapp`), a Hash
35
41
  # with the keys documented on {CashAppPaymentMethod}; you send :initialization ("disabled" or
36
42
  # "enabled") and :customer_profile_sharing (Boolean).
43
+ # :payment_methods may also include :paybybank (the key is the single lowercase word
44
+ # `paybybank`; the API ignores `pay_by_bank` without an error), a Hash with the keys documented
45
+ # on {PayByBankPaymentMethod}; you send :bank_id (the identifier of the bank the customer has
46
+ # selected for the payment).
47
+ # :payment_methods may also include (every key is optional unless marked required):
48
+ # - :card - :token (a Hash with :id, String, the Checkout.com card token), :details (the card
49
+ # data: :number (String, write-only), :expiry_month (Integer), :expiry_year (Integer), :name
50
+ # (String, write-only), :cvv (String, write-only), :stored (Boolean, write-only) and
51
+ # :allow_update (Boolean)), :store_for_future_use (Boolean, write-only), :phone
52
+ # (:country_code, String, min 1 character, max 7 characters, and :number, String, min 6
53
+ # characters, max 25 characters), :account_holder (:type, one of "individual", "government"
54
+ # or "corporate", :first_name, :last_name, :middle_name, :company_name (Strings) and
55
+ # :account_name_inquiry (Boolean)) and :preferred_scheme ("visa", "mastercard" or
56
+ # "cartes_bancaires"). The card data goes under :details; the API ignores it at the top level
57
+ # of :card.
58
+ # - :applepay - :token_data (write-only: :version, :data and :signature (Strings) and :header,
59
+ # a Hash with :ephemeral_public_key, :public_key_hash and :transaction_id (Strings)), :token (a
60
+ # Hash with :id, String, required, pattern ^(tok)_(\w{26})$, and :expires_on, date-time,
61
+ # ISO 8601; a String token is not accepted), :store_for_future_use (Boolean, write-only),
62
+ # :phone and :account_holder as on :card, and :preferred_scheme ("visa", "mastercard" or
63
+ # "cartes_bancaires"). Apple Pay has no :details.
64
+ # - :googlepay - :token_data (write-only: :protocol_version, :signature, :signed_message and
65
+ # :tokenization_key (Strings)), :token, :store_for_future_use, :phone and :account_holder as
66
+ # on :applepay, and :preferred_scheme ("visa" or "mastercard" only). Google Pay has no
67
+ # :details.
68
+ # - :instrument - :id (String, the unique identifier of the instrument to use).
69
+ # - :auto_confirm - String, the payment method that automatically confirms the payment when it
70
+ # is ready, for example "card".
71
+ # :settings may include :success_url and :failure_url (String, format uri, max 255
72
+ # characters), :capture (Boolean, whether to capture the payment immediately, default true) and
73
+ # :excluded_payment_methods (Array of Strings, payment method names, for example ["klarna"]).
74
+ # :order may include :sub_merchants, an Array of Hashes with :id (String), :product_category
75
+ # (String), :number_of_sales (Integer; the API does not define number_of_trades) and
76
+ # :registration_date (String, format date, yyyy-MM-dd).
77
+ # :metadata - A Hash of key/value pairs to attach to the payment (max 20 keys); each value is a
78
+ # String (max 255 characters), a Number or a Boolean.
79
+ # :risk {PaymentSetupRisk} - Risk assessment settings for the Payment Setup: :enabled
80
+ # (Boolean, whether a risk assessment should be performed, default true).
37
81
  # :customer may include:
38
82
  # - :id - The unique identifier of the customer.
39
83
  # - :country - The two-letter ISO country code of the customer for this payment
@@ -58,7 +102,11 @@ module CheckoutSdk
58
102
  # customer's device, one of {PaymentSetupDeviceOs}).
59
103
  # @return [Hash] The Payment Setup (swagger `PaymentSetup`, 200). For Cash App Pay, read
60
104
  # payment_methods.cashapp.action.redirect_url, payment_methods.cashapp.reference and, once only,
61
- # payment_methods.cashapp.customer_profile.
105
+ # payment_methods.cashapp.customer_profile. For Pay by Bank, read
106
+ # payment_methods.paybybank.action.banks. Card, Apple Pay and Google Pay return the read-only
107
+ # :schemes (supported card scheme names; Google Pay never lists cartes_bancaires) and card
108
+ # details :last4, :bin, :scheme (Strings) and :expires_on (date-time); instrument returns the
109
+ # read-only :type (String) and :action (:type, "set_instrument").
62
110
  def create_payment_setup(payment_setups_request)
63
111
  api_client.invoke_post(
64
112
  build_path(PAYMENTS_PATH, SETUPS_PATH),
@@ -81,12 +129,56 @@ module CheckoutSdk
81
129
  # :industry {PaymentSetupIndustry} (containing :accommodation
82
130
  # {Array(PaymentSetupAccommodation)} and :airline {Array(PaymentSetupAirline)}).
83
131
  # A Hash request is sent as is, so every nested value must be a Hash too. To use one of the
84
- # typed classes above (or {CashAppPaymentMethod}), convert it first with
132
+ # typed classes above (or {CashAppPaymentMethod}, {PayByBankPaymentMethod} or
133
+ # {PaymentSetupRisk}), convert it first with
85
134
  # CheckoutSdk::JsonSerializer.to_custom_hash(object); a typed object nested directly in the
86
135
  # Hash is not serialized and is sent as "#<CheckoutSdk::...>".
136
+ # :payment_type - String, the type of payment, one of {PaymentSetupPaymentType} (lowercase,
137
+ # unlike {PaymentType}): "regular", "recurring", "moto", "installment", "pay_later" or
138
+ # "unscheduled". Default "regular". You must provide it for card payments in which the
139
+ # cardholder is not present, for example a recurring payment or a mail order/telephone order
140
+ # (MOTO) payment.
87
141
  # :payment_methods may include :cashapp (the key is the single lowercase word `cashapp`), a Hash
88
142
  # with the keys documented on {CashAppPaymentMethod}; you send :initialization ("disabled" or
89
143
  # "enabled") and :customer_profile_sharing (Boolean).
144
+ # :payment_methods may also include :paybybank (the key is the single lowercase word
145
+ # `paybybank`; the API ignores `pay_by_bank` without an error), a Hash with the keys documented
146
+ # on {PayByBankPaymentMethod}; you send :bank_id (the identifier of the bank the customer has
147
+ # selected for the payment).
148
+ # :payment_methods may also include (every key is optional unless marked required):
149
+ # - :card - :token (a Hash with :id, String, the Checkout.com card token), :details (the card
150
+ # data: :number (String, write-only), :expiry_month (Integer), :expiry_year (Integer), :name
151
+ # (String, write-only), :cvv (String, write-only), :stored (Boolean, write-only) and
152
+ # :allow_update (Boolean)), :store_for_future_use (Boolean, write-only), :phone
153
+ # (:country_code, String, min 1 character, max 7 characters, and :number, String, min 6
154
+ # characters, max 25 characters), :account_holder (:type, one of "individual", "government"
155
+ # or "corporate", :first_name, :last_name, :middle_name, :company_name (Strings) and
156
+ # :account_name_inquiry (Boolean)) and :preferred_scheme ("visa", "mastercard" or
157
+ # "cartes_bancaires"). The card data goes under :details; the API ignores it at the top level
158
+ # of :card.
159
+ # - :applepay - :token_data (write-only: :version, :data and :signature (Strings) and :header,
160
+ # a Hash with :ephemeral_public_key, :public_key_hash and :transaction_id (Strings)), :token (a
161
+ # Hash with :id, String, required, pattern ^(tok)_(\w{26})$, and :expires_on, date-time,
162
+ # ISO 8601; a String token is not accepted), :store_for_future_use (Boolean, write-only),
163
+ # :phone and :account_holder as on :card, and :preferred_scheme ("visa", "mastercard" or
164
+ # "cartes_bancaires"). Apple Pay has no :details.
165
+ # - :googlepay - :token_data (write-only: :protocol_version, :signature, :signed_message and
166
+ # :tokenization_key (Strings)), :token, :store_for_future_use, :phone and :account_holder as
167
+ # on :applepay, and :preferred_scheme ("visa" or "mastercard" only). Google Pay has no
168
+ # :details.
169
+ # - :instrument - :id (String, the unique identifier of the instrument to use).
170
+ # - :auto_confirm - String, the payment method that automatically confirms the payment when it
171
+ # is ready, for example "card".
172
+ # :settings may include :success_url and :failure_url (String, format uri, max 255
173
+ # characters), :capture (Boolean, whether to capture the payment immediately, default true) and
174
+ # :excluded_payment_methods (Array of Strings, payment method names, for example ["klarna"]).
175
+ # :order may include :sub_merchants, an Array of Hashes with :id (String), :product_category
176
+ # (String), :number_of_sales (Integer; the API does not define number_of_trades) and
177
+ # :registration_date (String, format date, yyyy-MM-dd).
178
+ # :metadata - A Hash of key/value pairs to attach to the payment (max 20 keys); each value is a
179
+ # String (max 255 characters), a Number or a Boolean.
180
+ # :risk {PaymentSetupRisk} - Risk assessment settings for the Payment Setup: :enabled
181
+ # (Boolean, whether a risk assessment should be performed, default true).
90
182
  # :customer may include:
91
183
  # - :id - The unique identifier of the customer.
92
184
  # - :country - The two-letter ISO country code of the customer for this payment
@@ -111,7 +203,11 @@ module CheckoutSdk
111
203
  # customer's device, one of {PaymentSetupDeviceOs}).
112
204
  # @return [Hash] The Payment Setup (swagger `PaymentSetup`, 200). For Cash App Pay, read
113
205
  # payment_methods.cashapp.action.redirect_url, payment_methods.cashapp.reference and, once only,
114
- # payment_methods.cashapp.customer_profile.
206
+ # payment_methods.cashapp.customer_profile. For Pay by Bank, read
207
+ # payment_methods.paybybank.action.banks. Card, Apple Pay and Google Pay return the read-only
208
+ # :schemes (supported card scheme names; Google Pay never lists cartes_bancaires) and card
209
+ # details :last4, :bin, :scheme (Strings) and :expires_on (date-time); instrument returns the
210
+ # read-only :type (String) and :action (:type, "set_instrument").
115
211
  def update_payment_setup(id, payment_setups_request)
116
212
  api_client.invoke_put(
117
213
  build_path(PAYMENTS_PATH, SETUPS_PATH, id),
@@ -126,7 +222,11 @@ module CheckoutSdk
126
222
  # @param [String] id - The unique identifier of the Payment Setup to retrieve
127
223
  # @return [Hash] The Payment Setup (swagger `PaymentSetup`, 200). For Cash App Pay, read
128
224
  # payment_methods.cashapp.action.redirect_url, payment_methods.cashapp.reference and, once only,
129
- # payment_methods.cashapp.customer_profile.
225
+ # payment_methods.cashapp.customer_profile. For Pay by Bank, read
226
+ # payment_methods.paybybank.action.banks. Card, Apple Pay and Google Pay return the read-only
227
+ # :schemes (supported card scheme names; Google Pay never lists cartes_bancaires) and card
228
+ # details :last4, :bin, :scheme (Strings) and :expires_on (date-time); instrument returns the
229
+ # read-only :type (String) and :action (:type, "set_instrument").
130
230
  def get_payment_setup(id)
131
231
  api_client.invoke_get(
132
232
  build_path(PAYMENTS_PATH, SETUPS_PATH, id),
@@ -143,7 +243,11 @@ module CheckoutSdk
143
243
  # payment with (for example, "tabby", "klarna", "card" or "cashapp")
144
244
  # @return [Hash] The Payment Setup (swagger `PaymentSetup`, 200). For Cash App Pay, read
145
245
  # payment_methods.cashapp.action.redirect_url, payment_methods.cashapp.reference and, once only,
146
- # payment_methods.cashapp.customer_profile.
246
+ # payment_methods.cashapp.customer_profile. For Pay by Bank, read
247
+ # payment_methods.paybybank.action.banks. Card, Apple Pay and Google Pay return the read-only
248
+ # :schemes (supported card scheme names; Google Pay never lists cartes_bancaires) and card
249
+ # details :last4, :bin, :scheme (Strings) and :expires_on (date-time); instrument returns the
250
+ # read-only :type (String) and :action (:type, "set_instrument").
147
251
  def confirm_payment_setup(id, payment_method_name)
148
252
  api_client.invoke_post(
149
253
  build_path(PAYMENTS_PATH, SETUPS_PATH, id, CONFIRM_PATH, payment_method_name),
@@ -5,7 +5,8 @@ module CheckoutSdk
5
5
  # Stablecoin payment method configuration on a Payment Setup. Maps swagger `Stablecoin`.
6
6
  #
7
7
  # @!attribute status
8
- # @return [String] (response-only) Payment method status.
8
+ # @return [String] (response-only) Payment method status, one of
9
+ # {PaymentSetupPaymentMethodStatus} (e.g. "ready").
9
10
  # @!attribute flags
10
11
  # @return [Array(String)] (response-only) Diagnostic flags returned by the API.
11
12
  class StablecoinPaymentMethod
@@ -2,6 +2,14 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # A currency account source, with type currency_account.
6
+ # Used by card payouts, bank payouts and unreferenced refunds.
7
+ #
8
+ # id: the ID of the currency account that will fund the payout or the unreferenced refund. For bank
9
+ # payouts, its holding currency must match the payout's currency.
10
+ # [Required]
11
+ # ^(ca)_(\w{26})$
12
+ # 29 characters
5
13
  class CurrencyAccountSource < PayoutSource
6
14
  def initialize
7
15
  super(PayoutSourceType::CURRENCY_ACCOUNT)
@@ -2,6 +2,11 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # An entity source, with type entity. Bank payouts only.
6
+ #
7
+ # id: the entity or sub-entity's identifier, only applies to Platform Clients.
8
+ # [Required]
9
+ # ^(ent)_(\w{26})$
5
10
  class EntitySource < PayoutSource
6
11
  def initialize
7
12
  super(PayoutSourceType::ENTITY)
@@ -2,12 +2,23 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # The source of a card payout, bank payout or unreferenced refund.
6
+ #
5
7
  # @!attribute type
8
+ # The payout source type. Set by each subclass.
9
+ # [Required]
6
10
  # @return [String] {PayoutSourceType}
7
11
  # @!attribute id
12
+ # The identifier of the source. See {CurrencyAccountSource} and {EntitySource} for the format.
13
+ # [Required]
8
14
  # @return [String]
9
15
  # @!attribute amount
10
- # @return [String]
16
+ # The amount of the source.
17
+ # [Optional]
18
+ # @deprecated Not in the request schema of any payout or unreferenced refund source; still returned in
19
+ # PayoutDetails (source.amount). Retained for backwards compatibility and will be removed in the next
20
+ # major version. There is no replacement.
21
+ # @return [Integer]
11
22
  class PayoutSource
12
23
  attr_reader :type
13
24
  attr_accessor :id,
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # An unreferenced refund request, sent to POST /payments.
6
+ # The payment_type is set to UnreferencedRefund by the constructor.
7
+ #
8
+ # @!attribute source
9
+ # The source of the unreferenced refund.
10
+ # Only type and id are part of this position; amount is not used.
11
+ # [Required]
12
+ # @return [CurrencyAccountSource]
13
+ # @!attribute destination
14
+ # The destination of the unreferenced refund.
15
+ # Takes {CardDestination}, {NetworkTokenDestination}, {IdDestination} or {TokenDestination}.
16
+ # [Required]
17
+ # @return [Destination]
18
+ # @!attribute instruction
19
+ # Additional details about the unreferenced refund instruction.
20
+ # Only funds_transfer_type and purpose are part of this position.
21
+ # [Optional]
22
+ # @return [PaymentInstruction]
23
+ # @!attribute amount
24
+ # The amount in minor currency.
25
+ # [Required]
26
+ # Format: int64
27
+ # min 1
28
+ # max 9999999999
29
+ # @return [Integer]
30
+ # @!attribute currency
31
+ # The three-letter ISO currency code of the payment.
32
+ # [Required]
33
+ # 3 characters
34
+ # @return [String] {CheckoutSdk::Common::Currency}
35
+ # @!attribute payment_type
36
+ # The type of the payment. Set to UnreferencedRefund by the constructor.
37
+ # [Required]
38
+ # Enum: "UnreferencedRefund"
39
+ # @return [String]
40
+ # @!attribute processing_channel_id
41
+ # The processing channel identifier.
42
+ # [Required]
43
+ # ^(pc)_(\w{26})$
44
+ # @return [String]
45
+ # @!attribute reference
46
+ # An internal reference you can later use to identify this payment.
47
+ # [Optional]
48
+ # @return [String]
49
+ # @!attribute metadata
50
+ # A set of key-value pairs that you can attach to the refund request. It can be useful for storing
51
+ # additional information in a structured format. Note: this object only allows one level of depth,
52
+ # so cannot accept non-primitive data types such as objects or arrays.
53
+ # [Optional]
54
+ # @return [Hash{String => Object}]
55
+ # @!attribute previous_payment_id
56
+ # The previous related payment identifier. This could be the ID of the payment that you want to refund.
57
+ # [Optional]
58
+ # @return [String]
59
+ # @!attribute segment
60
+ # The dimension details about business segment for payment request. At least one dimension required.
61
+ # [Optional]
62
+ # @return [PaymentSegment]
63
+ # @!attribute processing
64
+ # Returns information related to the processing of the payment.
65
+ # Only processing_speed is part of this position.
66
+ # [Optional]
67
+ # @return [CardPayoutProcessing]
68
+ class UnreferencedRefundRequest
69
+ PAYMENT_TYPE = 'UnreferencedRefund'
70
+
71
+ attr_reader :payment_type
72
+ attr_accessor :source,
73
+ :destination,
74
+ :instruction,
75
+ :amount,
76
+ :currency,
77
+ :processing_channel_id,
78
+ :reference,
79
+ :metadata,
80
+ :previous_payment_id,
81
+ :segment,
82
+ :processing
83
+
84
+ def initialize
85
+ @payment_type = PAYMENT_TYPE
86
+ end
87
+ end
88
+ end
89
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '2.7.0'
4
+ VERSION = '2.8.0'
5
5
  end