checkout_sdk 2.0.0 → 2.2.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/checkout_sdk/apm/apm.rb +5 -0
  3. data/lib/checkout_sdk/apm/bacs/bacs_client.rb +29 -0
  4. data/lib/checkout_sdk/apm/bacs/bacs_notification_request.rb +52 -0
  5. data/lib/checkout_sdk/apm/bacs/bacs_notification_type.rb +10 -0
  6. data/lib/checkout_sdk/balances/balances.rb +3 -0
  7. data/lib/checkout_sdk/balances/balances_client.rb +37 -3
  8. data/lib/checkout_sdk/balances/top_up_bank_details.rb +22 -0
  9. data/lib/checkout_sdk/balances/top_up_funding_details.rb +53 -0
  10. data/lib/checkout_sdk/balances/top_up_instructions.rb +34 -0
  11. data/lib/checkout_sdk/checkout_api.rb +4 -0
  12. data/lib/checkout_sdk/common/account_holder_type.rb +16 -0
  13. data/lib/checkout_sdk/common/customer_request.rb +15 -3
  14. data/lib/checkout_sdk/common/instrument_type.rb +8 -0
  15. data/lib/checkout_sdk/common/payment_source_type.rb +19 -0
  16. data/lib/checkout_sdk/instruments/ach_account_type.rb +14 -0
  17. data/lib/checkout_sdk/instruments/bacs_payment_type.rb +15 -0
  18. data/lib/checkout_sdk/instruments/create/create_ach_account_holder.rb +29 -0
  19. data/lib/checkout_sdk/instruments/create/create_ach_instrument_data.rb +30 -0
  20. data/lib/checkout_sdk/instruments/create/create_bacs_account_holder.rb +24 -0
  21. data/lib/checkout_sdk/instruments/create/create_bacs_billing_address.rb +30 -0
  22. data/lib/checkout_sdk/instruments/create/create_bacs_instrument_account.rb +14 -0
  23. data/lib/checkout_sdk/instruments/create/create_bacs_instrument_data.rb +36 -0
  24. data/lib/checkout_sdk/instruments/create/create_sepa_account_holder.rb +28 -0
  25. data/lib/checkout_sdk/instruments/create/create_sepa_billing_address.rb +31 -0
  26. data/lib/checkout_sdk/instruments/create/create_sepa_instrument_data.rb +40 -0
  27. data/lib/checkout_sdk/instruments/create/instrument_ach.rb +25 -0
  28. data/lib/checkout_sdk/instruments/create/instrument_bacs.rb +29 -0
  29. data/lib/checkout_sdk/instruments/create/instrument_sepa.rb +9 -3
  30. data/lib/checkout_sdk/instruments/get/payment_network.rb +8 -4
  31. data/lib/checkout_sdk/instruments/instrument_account_holder_type.rb +14 -0
  32. data/lib/checkout_sdk/instruments/instruments.rb +28 -1
  33. data/lib/checkout_sdk/instruments/sepa_mandate_type.rb +11 -0
  34. data/lib/checkout_sdk/instruments/sepa_payment_type.rb +15 -0
  35. data/lib/checkout_sdk/instruments/update/update_ach_account_holder.rb +28 -0
  36. data/lib/checkout_sdk/instruments/update/update_ach_instrument_data.rb +32 -0
  37. data/lib/checkout_sdk/instruments/update/update_bacs_account_holder.rb +31 -0
  38. data/lib/checkout_sdk/instruments/update/update_bacs_billing_address.rb +30 -0
  39. data/lib/checkout_sdk/instruments/update/update_bacs_instrument_data.rb +36 -0
  40. data/lib/checkout_sdk/instruments/update/update_instrument_ach.rb +21 -0
  41. data/lib/checkout_sdk/instruments/update/update_instrument_bacs.rb +21 -0
  42. data/lib/checkout_sdk/instruments/update/update_instrument_sepa.rb +20 -0
  43. data/lib/checkout_sdk/instruments/update/update_sepa_account_holder.rb +31 -0
  44. data/lib/checkout_sdk/instruments/update/update_sepa_billing_address.rb +31 -0
  45. data/lib/checkout_sdk/instruments/update/update_sepa_instrument_data.rb +43 -0
  46. data/lib/checkout_sdk/json_serializer.rb +3 -1
  47. data/lib/checkout_sdk/oauth_scopes.rb +1 -0
  48. data/lib/checkout_sdk/payments/flow/flow_client.rb +6 -0
  49. data/lib/checkout_sdk/payments/payments.rb +22 -0
  50. data/lib/checkout_sdk/payments/setups/payment_setup_billing_descriptor.rb +19 -0
  51. data/lib/checkout_sdk/payments/setups/payment_setup_presentment_details.rb +17 -0
  52. data/lib/checkout_sdk/payments/setups/payment_setup_terminal.rb +16 -0
  53. data/lib/checkout_sdk/payments/setups/payment_setups_client.rb +11 -5
  54. data/lib/checkout_sdk/payments/source/apm/ach_source.rb +16 -5
  55. data/lib/checkout_sdk/payments/source/apm/ach_source_account_holder.rb +45 -0
  56. data/lib/checkout_sdk/payments/source/apm/ach_source_account_type.rb +22 -0
  57. data/lib/checkout_sdk/payments/source/apm/alipay_cn_source.rb +14 -0
  58. data/lib/checkout_sdk/payments/source/apm/alipay_hk_source.rb +14 -0
  59. data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +9 -0
  60. data/lib/checkout_sdk/payments/source/apm/bacs_source.rb +18 -0
  61. data/lib/checkout_sdk/payments/source/apm/dana_source.rb +14 -0
  62. data/lib/checkout_sdk/payments/source/apm/gcash_source.rb +14 -0
  63. data/lib/checkout_sdk/payments/source/apm/kakaopay_source.rb +14 -0
  64. data/lib/checkout_sdk/payments/source/apm/mobile_pay_source.rb +14 -0
  65. data/lib/checkout_sdk/payments/source/apm/pay_now_source.rb +14 -0
  66. data/lib/checkout_sdk/payments/source/apm/sepa_source.rb +28 -11
  67. data/lib/checkout_sdk/payments/source/apm/sepa_source_account_holder.rb +37 -0
  68. data/lib/checkout_sdk/payments/source/apm/sepa_source_billing_address.rb +31 -0
  69. data/lib/checkout_sdk/payments/source/apm/swish_account_holder.rb +18 -0
  70. data/lib/checkout_sdk/payments/source/apm/swish_billing_descriptor.rb +14 -0
  71. data/lib/checkout_sdk/payments/source/apm/swish_source.rb +29 -0
  72. data/lib/checkout_sdk/payments/source/apm/tng_source.rb +14 -0
  73. data/lib/checkout_sdk/payments/source/apm/truemoney_source.rb +14 -0
  74. data/lib/checkout_sdk/payments/source/apm/twint_source.rb +14 -0
  75. data/lib/checkout_sdk/payments/source/apm/vipps_source.rb +14 -0
  76. data/lib/checkout_sdk/version.rb +1 -1
  77. metadata +57 -3
  78. data/lib/checkout_sdk/instruments/create/instrument_data.rb +0 -26
@@ -32,8 +32,14 @@ module CheckoutSdk
32
32
  # Use this endpoint to submit payment details and process the payment for an existing session.
33
33
  # [Beta]
34
34
  #
35
+ # The request accepts `amount_allocations`: the sub-entities the payment is being
36
+ # processed on behalf of, min 1 max 50 items. Each entry maps to
37
+ # {CheckoutSdk::Common::AmountAllocations} (id, amount, reference, commission), where `id`
38
+ # and `amount` are required.
39
+ #
35
40
  # @param [String] id - The unique identifier of the Payment Session
36
41
  # @param [Hash] submit_payment_session_request
42
+ # @return [Hash] the payment submission response
37
43
  def submit_payment_session(id, submit_payment_session_request)
38
44
  api_client.invoke_post(
39
45
  build_path(PAYMENT_SESSIONS_PATH, id, SUBMIT_PATH),
@@ -94,6 +94,25 @@ require 'checkout_sdk/payments/source/apm/cv_connect_source'
94
94
  require 'checkout_sdk/payments/source/apm/trustly_source'
95
95
  require 'checkout_sdk/payments/source/apm/illicado_source'
96
96
  require 'checkout_sdk/payments/source/apm/sepa_source'
97
+ require 'checkout_sdk/payments/source/apm/bacs_source'
98
+ require 'checkout_sdk/payments/source/apm/ach_source_account_type'
99
+ require 'checkout_sdk/payments/source/apm/ach_source_account_holder'
100
+ require 'checkout_sdk/payments/source/apm/sepa_source_billing_address'
101
+ require 'checkout_sdk/payments/source/apm/sepa_source_account_holder'
102
+ require 'checkout_sdk/payments/source/apm/alipay_cn_source'
103
+ require 'checkout_sdk/payments/source/apm/alipay_hk_source'
104
+ require 'checkout_sdk/payments/source/apm/dana_source'
105
+ require 'checkout_sdk/payments/source/apm/gcash_source'
106
+ require 'checkout_sdk/payments/source/apm/kakaopay_source'
107
+ require 'checkout_sdk/payments/source/apm/mobile_pay_source'
108
+ require 'checkout_sdk/payments/source/apm/pay_now_source'
109
+ require 'checkout_sdk/payments/source/apm/tng_source'
110
+ require 'checkout_sdk/payments/source/apm/truemoney_source'
111
+ require 'checkout_sdk/payments/source/apm/twint_source'
112
+ require 'checkout_sdk/payments/source/apm/vipps_source'
113
+ require 'checkout_sdk/payments/source/apm/swish_account_holder'
114
+ require 'checkout_sdk/payments/source/apm/swish_billing_descriptor'
115
+ require 'checkout_sdk/payments/source/apm/swish_source'
97
116
  require 'checkout_sdk/payments/source/apm/ach_source'
98
117
  require 'checkout_sdk/payments/source/apm/bizum_source'
99
118
  require 'checkout_sdk/payments/source/apm/octopus_source'
@@ -191,6 +210,9 @@ require 'checkout_sdk/payments/setups/account_funding_transaction_identification
191
210
  require 'checkout_sdk/payments/setups/account_funding_transaction_sender'
192
211
  require 'checkout_sdk/payments/setups/account_funding_transaction_recipient'
193
212
  require 'checkout_sdk/payments/setups/payment_setup_account_funding_transaction'
213
+ require 'checkout_sdk/payments/setups/payment_setup_billing_descriptor'
214
+ require 'checkout_sdk/payments/setups/payment_setup_presentment_details'
215
+ require 'checkout_sdk/payments/setups/payment_setup_terminal'
194
216
  require 'checkout_sdk/payments/setups/blik_payment_method'
195
217
  require 'checkout_sdk/payments/setups/bacs_payment_method'
196
218
  require 'checkout_sdk/payments/setups/card_present_payment_method'
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The billing descriptor for payment.
6
+ #
7
+ # @!attribute name
8
+ # @return [String] A dynamic description of the payment. Max length: 25.
9
+ # @!attribute city
10
+ # @return [String] The city from which the payment was made. Max length: 13.
11
+ # @!attribute reference
12
+ # @return [String] The reference shown on the statement. Max length: 50.
13
+ class PaymentSetupBillingDescriptor
14
+ attr_accessor :name,
15
+ :city,
16
+ :reference
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The amount and currency to present to the customer, when the settlement
6
+ # currency differs from the customer-facing currency.
7
+ #
8
+ # @!attribute amount
9
+ # @return [Integer] The presentment amount, in the minor currency unit.
10
+ # @!attribute currency
11
+ # @return [String] The presentment currency, as a three-letter ISO currency code.
12
+ class PaymentSetupPresentmentDetails
13
+ attr_accessor :amount,
14
+ :currency
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Terminal details.
6
+ #
7
+ # @!attribute id
8
+ # @return [String] Terminal identifier. Length: 8.
9
+ # @!attribute local_date_time
10
+ # @return [String] The local date and time on the terminal, in ISO 8601 format.
11
+ class PaymentSetupTerminal
12
+ attr_accessor :id,
13
+ :local_date_time
14
+ end
15
+ end
16
+ end
@@ -22,6 +22,9 @@ module CheckoutSdk
22
22
  # [Beta]
23
23
  #
24
24
  # @param [Hash] payment_setups_request
25
+ # May include :billing_descriptor {PaymentSetupBillingDescriptor},
26
+ # :presentment_details {PaymentSetupPresentmentDetails} and
27
+ # :terminal {PaymentSetupTerminal}.
25
28
  def create_payment_setup(payment_setups_request)
26
29
  api_client.invoke_post(
27
30
  build_path(PAYMENTS_PATH, SETUPS_PATH),
@@ -38,6 +41,9 @@ module CheckoutSdk
38
41
  #
39
42
  # @param [String] id - The unique identifier of the Payment Setup to update
40
43
  # @param [Hash] payment_setups_request
44
+ # May include :billing_descriptor {PaymentSetupBillingDescriptor},
45
+ # :presentment_details {PaymentSetupPresentmentDetails} and
46
+ # :terminal {PaymentSetupTerminal}.
41
47
  def update_payment_setup(id, payment_setups_request)
42
48
  api_client.invoke_put(
43
49
  build_path(PAYMENTS_PATH, SETUPS_PATH, id),
@@ -58,15 +64,15 @@ module CheckoutSdk
58
64
  end
59
65
 
60
66
  # Confirms a Payment Setup to begin processing the payment request with your chosen
61
- # payment method option.
67
+ # payment method.
62
68
  # [Beta]
63
69
  #
64
70
  # @param [String] id - The unique identifier of the Payment Setup
65
- # @param [String] payment_method_option_id - The unique identifier of the payment option
66
- # to process the payment with
67
- def confirm_payment_setup(id, payment_method_option_id)
71
+ # @param [String] payment_method_name - The name of the payment method to process the
72
+ # payment with (for example, "tabby", "klarna", "card")
73
+ def confirm_payment_setup(id, payment_method_name)
68
74
  api_client.invoke_post(
69
- build_path(PAYMENTS_PATH, SETUPS_PATH, id, CONFIRM_PATH, payment_method_option_id),
75
+ build_path(PAYMENTS_PATH, SETUPS_PATH, id, CONFIRM_PATH, payment_method_name),
70
76
  sdk_authorization
71
77
  )
72
78
  end
@@ -2,16 +2,27 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # An ach payment source.
6
+ #
5
7
  # @!attribute account_type
6
- # @return [CheckoutSdk::Common::AccountType]
8
+ # @return [String] {AchSourceAccountType} The type of Direct Debit account.
9
+ # [Required] savings, checking or cash. Note this is **not**
10
+ # {CheckoutSdk::Common::AccountType}, which declares `current` instead of
11
+ # `checking` and is rejected at this position.
7
12
  # @!attribute country
8
- # @return [CheckoutSdk::Common::Country]
13
+ # @return [String] {CheckoutSdk::Common::Country} The source country.
14
+ # [Required] min 2 characters, max 2 characters.
9
15
  # @!attribute account_number
10
- # @return [String]
16
+ # @return [String] The account number of the Direct Debit account.
17
+ # [Required] min 4 characters, max 17 characters.
11
18
  # @!attribute bank_code
12
- # @return [String]
19
+ # @return [String] The bank code of the Direct Debit account.
20
+ # [Required] min 8 characters, max 9 characters.
13
21
  # @!attribute account_holder
14
- # @return [CheckoutSdk::Common::AccountHolder]
22
+ # @return [AchSourceAccountHolder] The account holder's details. [Required]
23
+ # Maps swagger `AccountHolderAch`. A {CheckoutSdk::Common::AccountHolder} or a
24
+ # Hash is still accepted, but only the seven properties that schema declares
25
+ # are valid at this position.
15
26
  class AchSource < PaymentSource
16
27
  attr_accessor :account_type,
17
28
  :country,
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The account holder's details on an ACH payment source.
6
+ #
7
+ # Maps swagger `AccountHolderAch` exactly. This is deliberately not
8
+ # {CheckoutSdk::Common::AccountHolder}, which carries 16 properties against the
9
+ # seven declared here.
10
+ #
11
+ # Two nested types are reused rather than redeclared, because their property sets
12
+ # match: `billing_address` uses {CheckoutSdk::Common::Address}, whose six
13
+ # properties are exactly the `Address` schema this position references. For
14
+ # `identification` the reused type carries one property, date_of_expiry, that this
15
+ # position does not declare - noted on the attribute below.
16
+ #
17
+ # @!attribute type
18
+ # @return [String] {CheckoutSdk::Common::AccountHolderType} The type of account
19
+ # holder. [Required] individual, corporate or government.
20
+ # @!attribute first_name
21
+ # @return [String] The account holder's first name. [Required]
22
+ # @!attribute last_name
23
+ # @return [String] The account holder's last name. [Required]
24
+ # @!attribute company_name
25
+ # @return [String] The account holder's company name. [Optional]
26
+ # @!attribute billing_address
27
+ # @return [CheckoutSdk::Common::Address] The account holder's billing address.
28
+ # [Optional]
29
+ # @!attribute date_of_birth
30
+ # @return [String] The account holder's date of birth. [Optional]
31
+ # @!attribute identification
32
+ # @return [CheckoutSdk::Common::AccountHolderIdentification] The account
33
+ # holder's identification. [Optional] This position declares only type,
34
+ # issuing_country and number - do not set date_of_expiry.
35
+ class AchSourceAccountHolder
36
+ attr_accessor :type,
37
+ :first_name,
38
+ :last_name,
39
+ :company_name,
40
+ :billing_address,
41
+ :date_of_birth,
42
+ :identification
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The type of Direct Debit account on an ACH payment source.
6
+ #
7
+ # `PaymentRequestAchSource` is the only position in the specification declaring
8
+ # this set. Two neighbouring types are deliberately different and must not be
9
+ # substituted:
10
+ #
11
+ # - {CheckoutSdk::Common::AccountType} is savings / **current** / cash, and serves
12
+ # the bank-account instrument and destination positions. It does not declare
13
+ # `checking`, so it cannot express a valid ACH source account type.
14
+ # - {CheckoutSdk::Instruments::AchAccountType} is savings / checking, and serves
15
+ # the stored ACH instrument positions. It does not declare `cash`.
16
+ module AchSourceAccountType
17
+ SAVINGS = 'savings'
18
+ CHECKING = 'checking'
19
+ CASH = 'cash'
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Alipay CN source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class AlipayCnSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::ALIPAY_CN)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Alipay HK source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class AlipayHkSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::ALIPAY_HK)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -2,6 +2,15 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # Alipay Plus source.
6
+ #
7
+ # The specification gives each of these wire types its own schema and its own
8
+ # entry on the `PaymentRequestSource` discriminator, so each also has a dedicated
9
+ # class: {AlipayPlusSource} for `alipay_plus` itself, plus {AlipayCnSource},
10
+ # {AlipayHkSource}, {DanaSource}, {GcashSource}, {KakaopaySource},
11
+ # {TruemoneySource} and {TngSource}. Prefer the dedicated class. The factory
12
+ # methods below are retained for backward compatibility and produce identical
13
+ # JSON.
5
14
  class AlipayPlusSource < PaymentSource
6
15
  # @return [AlipayPlusSource] of type {CheckoutSdk::Common::PaymentSourceType::ALIPAY_PLUS}
7
16
  def self.alipay_plus_source
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Bacs Direct Debit source.
6
+ #
7
+ # @!attribute id
8
+ # @return [String] The Bacs Direct Debit instrument ID. [Required]
9
+ # Pattern: ^(src)_(\w{26})$
10
+ class BacsSource < PaymentSource
11
+ attr_accessor :id
12
+
13
+ def initialize
14
+ super(CheckoutSdk::Common::PaymentSourceType::BACS)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # DANA source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class DanaSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::DANA)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # GCash source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class GcashSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::GCASH)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Kakao Pay source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class KakaopaySource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::KAKAOPAY)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # MobilePay source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class MobilePaySource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::MOBILEPAY)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # PayNow source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class PayNowSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::PAYNOW)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -2,28 +2,45 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # SEPA Direct Debit source.
6
+ #
5
7
  # @!attribute country
6
- # @return [CheckoutSdk::Common::Country]
8
+ # @return [String] {CheckoutSdk::Common::Country} The account's country, as an
9
+ # ISO 3166-1 alpha-2 code. [Required]
7
10
  # @!attribute account_number
8
- # @return [String]
9
- # @!attribute bank_code
10
- # @return [String]
11
+ # @return [String] The account holder's IBAN. [Required]
11
12
  # @!attribute currency
12
- # @return [CheckoutSdk::Common::Currency]
13
+ # @return [String] {CheckoutSdk::Common::Currency} The account holder's account
14
+ # currency. [Required]
15
+ # @!attribute account_holder
16
+ # @return [SepaSourceAccountHolder] The account holder's personal information.
17
+ # [Required] Its billing_address is required, and that address requires all
18
+ # five of its properties. A {CheckoutSdk::Common::AccountHolder} or a Hash is
19
+ # still accepted, but only the five properties
20
+ # `PaymentRequestSEPAV4Source.account_holder` declares are valid here. See
21
+ # {SepaSourceAccountHolder#type} for the casing to send.
13
22
  # @!attribute mandate_id
14
- # @return [String]
23
+ # @return [String] The ID of the mandate. [Optional]
24
+ # @!attribute mandate_type
25
+ # @return [String] {CheckoutSdk::Instruments::SepaMandateType} The type of
26
+ # mandate, Core or B2B. [Optional]
15
27
  # @!attribute date_of_signature
16
- # @return [String]
17
- # @!attribute account_holder
18
- # @return [CheckoutSdk::Common::AccountHolder]
28
+ # @return [String] The date the mandate was signed, in the format yyyy-MM-dd.
29
+ # [Optional]
30
+ # @!attribute bank_code
31
+ # @return [String] Not declared by PaymentRequestSEPAV4Source. No SEPA schema
32
+ # in the specification declares a bank code, and the SEPA source is
33
+ # identified by IBAN through account_number. Retained for
34
+ # retro-compatibility purposes only. Possibly an obsoleted field.
19
35
  class SepaSource < PaymentSource
20
36
  attr_accessor :country,
21
37
  :account_number,
22
- :bank_code,
23
38
  :currency,
39
+ :account_holder,
24
40
  :mandate_id,
41
+ :mandate_type,
25
42
  :date_of_signature,
26
- :account_holder
43
+ :bank_code
27
44
 
28
45
  def initialize
29
46
  super(CheckoutSdk::Common::PaymentSourceType::SEPA)
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The account holder's personal information on a SEPA payment source.
6
+ #
7
+ # Maps the `account_holder` object of swagger `PaymentRequestSEPAV4Source`
8
+ # exactly. This is deliberately not {CheckoutSdk::Common::AccountHolder}, which
9
+ # carries 16 properties against the five declared here.
10
+ #
11
+ # @!attribute billing_address
12
+ # @return [SepaSourceBillingAddress] The account holder's billing address.
13
+ # [Required] All five of its properties are required.
14
+ # @!attribute first_name
15
+ # @return [String] The account holder's first name. [Optional]
16
+ # max 50 characters.
17
+ # @!attribute last_name
18
+ # @return [String] The account holder's last name. [Optional]
19
+ # max 50 characters.
20
+ # @!attribute company_name
21
+ # @return [String] The account holder's company name. [Optional]
22
+ # max 50 characters.
23
+ # @!attribute type
24
+ # @return [String] {InstrumentAccountHolderType} The type of account holder.
25
+ # [Optional] Send this lowercase (individual / corporate). The specification
26
+ # declares it capitalized at this one position, but every other
27
+ # account-holder-type position declares it lowercase and every other
28
+ # Checkout.com SDK sends lowercase. Pending confirmation from the API owners.
29
+ class SepaSourceAccountHolder
30
+ attr_accessor :billing_address,
31
+ :first_name,
32
+ :last_name,
33
+ :company_name,
34
+ :type
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # The account holder's billing address on a SEPA payment source.
6
+ #
7
+ # Every property is required. This is deliberately not
8
+ # {CheckoutSdk::Common::Address}, which also declares `state` - a property this
9
+ # position does not accept.
10
+ #
11
+ # @!attribute address_line1
12
+ # @return [String] The account holder's street name. [Required]
13
+ # @!attribute address_line2
14
+ # @return [String] The account holder's street number. [Required]
15
+ # max 10 characters.
16
+ # @!attribute city
17
+ # @return [String] The account holder's city. [Required] max 35 characters.
18
+ # @!attribute zip
19
+ # @return [String] The account holder's zip code. [Required] max 16 characters.
20
+ # @!attribute country
21
+ # @return [String] {CheckoutSdk::Common::Country} The account holder's country,
22
+ # as an ISO 3166-1 alpha-2 code. [Required] max 2 characters.
23
+ class SepaSourceBillingAddress
24
+ attr_accessor :address_line1,
25
+ :address_line2,
26
+ :city,
27
+ :zip,
28
+ :country
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Information about the account holder's details on a Swish payment source.
6
+ #
7
+ # @!attribute first_name
8
+ # @return [String] The account holder's first name. [Required]
9
+ # max 50 characters.
10
+ # @!attribute last_name
11
+ # @return [String] The account holder's last name. [Required]
12
+ # max 50 characters.
13
+ class SwishAccountHolder
14
+ attr_accessor :first_name,
15
+ :last_name
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Payment billing descriptor on a Swish payment source.
6
+ #
7
+ # @!attribute name
8
+ # @return [String] A description for the payment, which displays on the
9
+ # customer's statement. [Required] max 120 characters.
10
+ class SwishBillingDescriptor
11
+ attr_accessor :name
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Swish source.
6
+ #
7
+ # @!attribute payment_country
8
+ # @return [String] The 2-letter ISO country code of the country in which the
9
+ # payment instrument is issued or operated. [Required] The schema declares
10
+ # one value only: SE. min 2 characters, max 2 characters.
11
+ # @!attribute account_holder
12
+ # @return [SwishAccountHolder] Information about the account holder's details.
13
+ # [Required]
14
+ # @!attribute billing_descriptor
15
+ # @return [SwishBillingDescriptor] Payment billing descriptor. [Optional]
16
+ class SwishSource < PaymentSource
17
+ # The only payment_country the schema declares.
18
+ SWEDEN = 'SE'
19
+
20
+ attr_accessor :payment_country,
21
+ :account_holder,
22
+ :billing_descriptor
23
+
24
+ def initialize
25
+ super(CheckoutSdk::Common::PaymentSourceType::SWISH)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Touch n Go source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class TngSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::TNG)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # TrueMoney source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class TruemoneySource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::TRUEMONEY)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # TWINT source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class TwintSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::TWINT)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # Vipps source.
6
+ #
7
+ # The schema declares no properties beyond `type`.
8
+ class VippsSource < PaymentSource
9
+ def initialize
10
+ super(CheckoutSdk::Common::PaymentSourceType::VIPPS)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '2.0.0'
4
+ VERSION = '2.2.0'
5
5
  end