checkout_sdk 1.12.0 → 2.1.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -1
  3. data/lib/checkout_sdk/abstract_checkout_sdk_builder.rb +55 -4
  4. data/lib/checkout_sdk/accounts/schedule_frequency_daily.rb +2 -0
  5. data/lib/checkout_sdk/accounts/schedule_frequency_monthly.rb +3 -1
  6. data/lib/checkout_sdk/accounts/schedule_frequency_weekly.rb +3 -1
  7. data/lib/checkout_sdk/accounts/update_schedule.rb +11 -0
  8. data/lib/checkout_sdk/apm/apm.rb +5 -0
  9. data/lib/checkout_sdk/apm/bacs/bacs_client.rb +29 -0
  10. data/lib/checkout_sdk/apm/bacs/bacs_notification_request.rb +52 -0
  11. data/lib/checkout_sdk/apm/bacs/bacs_notification_type.rb +10 -0
  12. data/lib/checkout_sdk/checkout_api.rb +4 -0
  13. data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +23 -10
  14. data/lib/checkout_sdk/checkout_static_keys_sdk_builder.rb +2 -1
  15. data/lib/checkout_sdk/common/account_holder_type.rb +16 -0
  16. data/lib/checkout_sdk/common/customer_request.rb +15 -3
  17. data/lib/checkout_sdk/common/instrument_type.rb +8 -0
  18. data/lib/checkout_sdk/common/payment_source_type.rb +19 -0
  19. data/lib/checkout_sdk/environment_subdomain.rb +22 -23
  20. data/lib/checkout_sdk/instruments/ach_account_type.rb +14 -0
  21. data/lib/checkout_sdk/instruments/bacs_payment_type.rb +15 -0
  22. data/lib/checkout_sdk/instruments/create/create_ach_account_holder.rb +29 -0
  23. data/lib/checkout_sdk/instruments/create/create_ach_instrument_data.rb +30 -0
  24. data/lib/checkout_sdk/instruments/create/create_bacs_account_holder.rb +24 -0
  25. data/lib/checkout_sdk/instruments/create/create_bacs_billing_address.rb +30 -0
  26. data/lib/checkout_sdk/instruments/create/create_bacs_instrument_account.rb +14 -0
  27. data/lib/checkout_sdk/instruments/create/create_bacs_instrument_data.rb +36 -0
  28. data/lib/checkout_sdk/instruments/create/create_sepa_account_holder.rb +28 -0
  29. data/lib/checkout_sdk/instruments/create/create_sepa_billing_address.rb +31 -0
  30. data/lib/checkout_sdk/instruments/create/create_sepa_instrument_data.rb +40 -0
  31. data/lib/checkout_sdk/instruments/create/instrument_ach.rb +25 -0
  32. data/lib/checkout_sdk/instruments/create/instrument_bacs.rb +29 -0
  33. data/lib/checkout_sdk/instruments/create/instrument_sepa.rb +9 -3
  34. data/lib/checkout_sdk/instruments/get/payment_network.rb +8 -4
  35. data/lib/checkout_sdk/instruments/instrument_account_holder_type.rb +14 -0
  36. data/lib/checkout_sdk/instruments/instruments.rb +28 -1
  37. data/lib/checkout_sdk/instruments/sepa_mandate_type.rb +11 -0
  38. data/lib/checkout_sdk/instruments/sepa_payment_type.rb +15 -0
  39. data/lib/checkout_sdk/instruments/update/update_ach_account_holder.rb +28 -0
  40. data/lib/checkout_sdk/instruments/update/update_ach_instrument_data.rb +32 -0
  41. data/lib/checkout_sdk/instruments/update/update_bacs_account_holder.rb +31 -0
  42. data/lib/checkout_sdk/instruments/update/update_bacs_billing_address.rb +30 -0
  43. data/lib/checkout_sdk/instruments/update/update_bacs_instrument_data.rb +36 -0
  44. data/lib/checkout_sdk/instruments/update/update_instrument_ach.rb +21 -0
  45. data/lib/checkout_sdk/instruments/update/update_instrument_bacs.rb +21 -0
  46. data/lib/checkout_sdk/instruments/update/update_instrument_sepa.rb +20 -0
  47. data/lib/checkout_sdk/instruments/update/update_sepa_account_holder.rb +31 -0
  48. data/lib/checkout_sdk/instruments/update/update_sepa_billing_address.rb +31 -0
  49. data/lib/checkout_sdk/instruments/update/update_sepa_instrument_data.rb +43 -0
  50. data/lib/checkout_sdk/payments/payments.rb +19 -0
  51. data/lib/checkout_sdk/payments/source/apm/ach_source.rb +16 -5
  52. data/lib/checkout_sdk/payments/source/apm/ach_source_account_holder.rb +45 -0
  53. data/lib/checkout_sdk/payments/source/apm/ach_source_account_type.rb +22 -0
  54. data/lib/checkout_sdk/payments/source/apm/alipay_cn_source.rb +14 -0
  55. data/lib/checkout_sdk/payments/source/apm/alipay_hk_source.rb +14 -0
  56. data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +9 -0
  57. data/lib/checkout_sdk/payments/source/apm/bacs_source.rb +18 -0
  58. data/lib/checkout_sdk/payments/source/apm/dana_source.rb +14 -0
  59. data/lib/checkout_sdk/payments/source/apm/gcash_source.rb +14 -0
  60. data/lib/checkout_sdk/payments/source/apm/kakaopay_source.rb +14 -0
  61. data/lib/checkout_sdk/payments/source/apm/mobile_pay_source.rb +14 -0
  62. data/lib/checkout_sdk/payments/source/apm/pay_now_source.rb +14 -0
  63. data/lib/checkout_sdk/payments/source/apm/sepa_source.rb +28 -11
  64. data/lib/checkout_sdk/payments/source/apm/sepa_source_account_holder.rb +37 -0
  65. data/lib/checkout_sdk/payments/source/apm/sepa_source_billing_address.rb +31 -0
  66. data/lib/checkout_sdk/payments/source/apm/swish_account_holder.rb +18 -0
  67. data/lib/checkout_sdk/payments/source/apm/swish_billing_descriptor.rb +14 -0
  68. data/lib/checkout_sdk/payments/source/apm/swish_source.rb +29 -0
  69. data/lib/checkout_sdk/payments/source/apm/tng_source.rb +14 -0
  70. data/lib/checkout_sdk/payments/source/apm/truemoney_source.rb +14 -0
  71. data/lib/checkout_sdk/payments/source/apm/twint_source.rb +14 -0
  72. data/lib/checkout_sdk/payments/source/apm/vipps_source.rb +14 -0
  73. data/lib/checkout_sdk/payments/void_request.rb +5 -1
  74. data/lib/checkout_sdk/previous/checkout_previous_static_keys_sdk_builder.rb +8 -1
  75. data/lib/checkout_sdk/version.rb +1 -1
  76. metadata +51 -3
  77. data/lib/checkout_sdk/instruments/create/instrument_data.rb +0 -26
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Instruments
5
+ # The account holder details of a SEPA instrument being updated.
6
+ #
7
+ # account_holder is itself optional, but if you send it then first_name,
8
+ # last_name and billing_address are all required.
9
+ #
10
+ # @!attribute first_name
11
+ # @return [String] The first name of the account holder. [Required]
12
+ # @!attribute last_name
13
+ # @return [String] The last name of the account holder. [Required]
14
+ # @!attribute billing_address
15
+ # @return [UpdateSepaBillingAddress] The billing address of the account
16
+ # holder. [Required]
17
+ # @!attribute company_name
18
+ # @return [String] The legal name of a registered company that holds the
19
+ # account. [Optional] max 50 characters.
20
+ # @!attribute type
21
+ # @return [String] {InstrumentAccountHolderType} The type of account holder.
22
+ # [Optional]
23
+ class UpdateSepaAccountHolder
24
+ attr_accessor :first_name,
25
+ :last_name,
26
+ :billing_address,
27
+ :company_name,
28
+ :type
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Instruments
5
+ # The billing address of the account holder of a SEPA instrument being updated.
6
+ #
7
+ # Every property is required if billing_address is sent at all.
8
+ #
9
+ # @!attribute address_line1
10
+ # @return [String] The first line of the address. [Required] max 200 characters.
11
+ # @!attribute address_line2
12
+ # @return [String] The street number. If no number, pass "w/n".
13
+ # [Required] max 10 characters.
14
+ # @!attribute city
15
+ # @return [String] The address city. [Required] max 50 characters.
16
+ # Note the store variant allows max 35 only.
17
+ # @!attribute zip
18
+ # @return [String] The address zip/postal code. [Required] max 50 characters.
19
+ # Note the store variant allows max 16 only.
20
+ # @!attribute country
21
+ # @return [String] {CheckoutSdk::Common::Country} The two-letter ISO country
22
+ # code of the address. [Required] min 2 characters, max 2 characters.
23
+ class UpdateSepaBillingAddress
24
+ attr_accessor :address_line1,
25
+ :address_line2,
26
+ :city,
27
+ :zip,
28
+ :country
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Instruments
5
+ # The details of the mandate of a SEPA instrument being updated.
6
+ #
7
+ # instrument_data is itself optional, but if you send it then account_number,
8
+ # country, currency and payment_type are all required.
9
+ #
10
+ # @!attribute account_number
11
+ # @return [String] The International Bank Account Number (IBAN) of the
12
+ # account. [Required] min 15 characters, max 34 characters.
13
+ # @!attribute country
14
+ # @return [String] {CheckoutSdk::Common::Country} The country of the account.
15
+ # [Required] min 2 characters, max 2 characters.
16
+ # @!attribute currency
17
+ # @return [String] {CheckoutSdk::Common::Currency} The currency of the account.
18
+ # [Required] min 3 characters, max 3 characters.
19
+ # @!attribute payment_type
20
+ # @return [String] {SepaPaymentType} The type of payment, recurring or
21
+ # regular. [Required] Lowercase, unlike the Bacs equivalent.
22
+ # @!attribute type
23
+ # @return [String] {SepaMandateType} The type of mandate, Core or B2B.
24
+ # [Optional]
25
+ # @!attribute mandate_id
26
+ # @return [String] The mandate ID. If a mandate ID is not provided, a new,
27
+ # random mandate ID will be generated. [Optional] min 1 character,
28
+ # max 35 characters.
29
+ # @!attribute date_of_signature
30
+ # @return [String] The date on which the mandate was signed, in the format
31
+ # yyyy-MM-dd. Required if mandate_id is provided. [Optional]
32
+ # Format: date - pass a yyyy-MM-dd String, not a DateTime.
33
+ class UpdateSepaInstrumentData
34
+ attr_accessor :account_number,
35
+ :country,
36
+ :currency,
37
+ :payment_type,
38
+ :type,
39
+ :mandate_id,
40
+ :date_of_signature
41
+ end
42
+ end
43
+ end
@@ -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'
@@ -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
@@ -2,12 +2,16 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # @!attribute amount
6
+ # @return [Integer] the amount to void, min 0, max 9999999999.
7
+ # If not specified, the full payment amount is voided.
5
8
  # @!attribute reference
6
9
  # @return [String]
7
10
  # @!attribute metadata
8
11
  # @return [Hash{String => Object}]
9
12
  class VoidRequest
10
- attr_accessor :reference,
13
+ attr_accessor :amount,
14
+ :reference,
11
15
  :metadata
12
16
  end
13
17
  end