checkout_sdk 2.0.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.
- checksums.yaml +4 -4
- data/lib/checkout_sdk/apm/apm.rb +5 -0
- data/lib/checkout_sdk/apm/bacs/bacs_client.rb +29 -0
- data/lib/checkout_sdk/apm/bacs/bacs_notification_request.rb +52 -0
- data/lib/checkout_sdk/apm/bacs/bacs_notification_type.rb +10 -0
- data/lib/checkout_sdk/checkout_api.rb +4 -0
- data/lib/checkout_sdk/common/account_holder_type.rb +16 -0
- data/lib/checkout_sdk/common/customer_request.rb +15 -3
- data/lib/checkout_sdk/common/instrument_type.rb +8 -0
- data/lib/checkout_sdk/common/payment_source_type.rb +19 -0
- data/lib/checkout_sdk/instruments/ach_account_type.rb +14 -0
- data/lib/checkout_sdk/instruments/bacs_payment_type.rb +15 -0
- data/lib/checkout_sdk/instruments/create/create_ach_account_holder.rb +29 -0
- data/lib/checkout_sdk/instruments/create/create_ach_instrument_data.rb +30 -0
- data/lib/checkout_sdk/instruments/create/create_bacs_account_holder.rb +24 -0
- data/lib/checkout_sdk/instruments/create/create_bacs_billing_address.rb +30 -0
- data/lib/checkout_sdk/instruments/create/create_bacs_instrument_account.rb +14 -0
- data/lib/checkout_sdk/instruments/create/create_bacs_instrument_data.rb +36 -0
- data/lib/checkout_sdk/instruments/create/create_sepa_account_holder.rb +28 -0
- data/lib/checkout_sdk/instruments/create/create_sepa_billing_address.rb +31 -0
- data/lib/checkout_sdk/instruments/create/create_sepa_instrument_data.rb +40 -0
- data/lib/checkout_sdk/instruments/create/instrument_ach.rb +25 -0
- data/lib/checkout_sdk/instruments/create/instrument_bacs.rb +29 -0
- data/lib/checkout_sdk/instruments/create/instrument_sepa.rb +9 -3
- data/lib/checkout_sdk/instruments/get/payment_network.rb +8 -4
- data/lib/checkout_sdk/instruments/instrument_account_holder_type.rb +14 -0
- data/lib/checkout_sdk/instruments/instruments.rb +28 -1
- data/lib/checkout_sdk/instruments/sepa_mandate_type.rb +11 -0
- data/lib/checkout_sdk/instruments/sepa_payment_type.rb +15 -0
- data/lib/checkout_sdk/instruments/update/update_ach_account_holder.rb +28 -0
- data/lib/checkout_sdk/instruments/update/update_ach_instrument_data.rb +32 -0
- data/lib/checkout_sdk/instruments/update/update_bacs_account_holder.rb +31 -0
- data/lib/checkout_sdk/instruments/update/update_bacs_billing_address.rb +30 -0
- data/lib/checkout_sdk/instruments/update/update_bacs_instrument_data.rb +36 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_ach.rb +21 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_bacs.rb +21 -0
- data/lib/checkout_sdk/instruments/update/update_instrument_sepa.rb +20 -0
- data/lib/checkout_sdk/instruments/update/update_sepa_account_holder.rb +31 -0
- data/lib/checkout_sdk/instruments/update/update_sepa_billing_address.rb +31 -0
- data/lib/checkout_sdk/instruments/update/update_sepa_instrument_data.rb +43 -0
- data/lib/checkout_sdk/payments/payments.rb +19 -0
- data/lib/checkout_sdk/payments/source/apm/ach_source.rb +16 -5
- data/lib/checkout_sdk/payments/source/apm/ach_source_account_holder.rb +45 -0
- data/lib/checkout_sdk/payments/source/apm/ach_source_account_type.rb +22 -0
- data/lib/checkout_sdk/payments/source/apm/alipay_cn_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/alipay_hk_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +9 -0
- data/lib/checkout_sdk/payments/source/apm/bacs_source.rb +18 -0
- data/lib/checkout_sdk/payments/source/apm/dana_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/gcash_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/kakaopay_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/mobile_pay_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/pay_now_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/sepa_source.rb +28 -11
- data/lib/checkout_sdk/payments/source/apm/sepa_source_account_holder.rb +37 -0
- data/lib/checkout_sdk/payments/source/apm/sepa_source_billing_address.rb +31 -0
- data/lib/checkout_sdk/payments/source/apm/swish_account_holder.rb +18 -0
- data/lib/checkout_sdk/payments/source/apm/swish_billing_descriptor.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/swish_source.rb +29 -0
- data/lib/checkout_sdk/payments/source/apm/tng_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/truemoney_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/twint_source.rb +14 -0
- data/lib/checkout_sdk/payments/source/apm/vipps_source.rb +14 -0
- data/lib/checkout_sdk/version.rb +1 -1
- metadata +51 -3
- data/lib/checkout_sdk/instruments/create/instrument_data.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d496e04f8a60b750fdd7a6bc7c9f8bde76ee833c436b706523066e18d71d2fc7
|
|
4
|
+
data.tar.gz: 8be2c185284697143ff7caf40146ffb1e068ba507ad1ab9acc8a87f06411731d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bdd1474da6e0172ab1a935756b9bee04d7f533ae60107332337b9ee1ef98623af15474d3f52f228065515397c280bfebdc5f3eff1bec62c9859eb7e38ccc7ff
|
|
7
|
+
data.tar.gz: e37204701650121c179389ec329d96f6cc42b6e55334a5852ea0806543a9774377fa4efcad67b11d159fb29cf62fa895d2868b64308a22a72b332354096ff35b
|
data/lib/checkout_sdk/apm/apm.rb
CHANGED
|
@@ -9,3 +9,8 @@ require 'checkout_sdk/apm/previous/klarna/order_capture_request'
|
|
|
9
9
|
require 'checkout_sdk/apm/previous/klarna/klarna_client'
|
|
10
10
|
require 'checkout_sdk/apm/previous/sepa/sepa_client'
|
|
11
11
|
require 'checkout_sdk/apm/ideal/ideal_client'
|
|
12
|
+
|
|
13
|
+
# Bacs
|
|
14
|
+
require 'checkout_sdk/apm/bacs/bacs_notification_type'
|
|
15
|
+
require 'checkout_sdk/apm/bacs/bacs_notification_request'
|
|
16
|
+
require 'checkout_sdk/apm/bacs/bacs_client'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Apm
|
|
5
|
+
# Bacs Direct Debit client.
|
|
6
|
+
class BacsClient < Client
|
|
7
|
+
APMS = 'apms'
|
|
8
|
+
BACS_NOTIFICATIONS = 'bacs/notifications'
|
|
9
|
+
private_constant :APMS, :BACS_NOTIFICATIONS
|
|
10
|
+
|
|
11
|
+
# @param [ApiClient] api_client
|
|
12
|
+
# @param [CheckoutConfiguration] configuration
|
|
13
|
+
def initialize(api_client, configuration)
|
|
14
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Sends a Bacs Direct Debit pre-notification (advance notice) to a payer ahead
|
|
18
|
+
# of collecting funds from their account.
|
|
19
|
+
#
|
|
20
|
+
# @param [Hash, BacsNotificationRequest] bacs_notification_request
|
|
21
|
+
# @return [Hash] the BacsNotificationResponse, carrying event_id.
|
|
22
|
+
def send_notification(bacs_notification_request)
|
|
23
|
+
api_client.invoke_post(build_path(APMS, BACS_NOTIFICATIONS),
|
|
24
|
+
sdk_authorization,
|
|
25
|
+
bacs_notification_request)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Apm
|
|
5
|
+
# Bacs Direct Debit notification request.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute source_id
|
|
8
|
+
# @return [String] The ID of the Bacs Direct Debit instrument to notify
|
|
9
|
+
# against. [Required] Pattern: ^(src)_(\w{26})$
|
|
10
|
+
# @!attribute notification_type
|
|
11
|
+
# @return [String] {BacsNotificationType} The type of pre-notification being
|
|
12
|
+
# sent to the payer. [Required]
|
|
13
|
+
# @!attribute collection_date
|
|
14
|
+
# @return [String] The date the funds will be collected from the payer's
|
|
15
|
+
# account, in the format yyyy-MM-dd. [Required]
|
|
16
|
+
# Format: date - pass a yyyy-MM-dd String, not a DateTime.
|
|
17
|
+
# @!attribute amount
|
|
18
|
+
# @return [Integer] The amount to be collected, in the currency's minor unit.
|
|
19
|
+
# [Required] min 1
|
|
20
|
+
# @!attribute currency
|
|
21
|
+
# @return [String] {CheckoutSdk::Common::Currency} The three-letter ISO 4217
|
|
22
|
+
# currency code of the collection. [Required] min 3 characters,
|
|
23
|
+
# max 3 characters.
|
|
24
|
+
# @!attribute billing_descriptor
|
|
25
|
+
# @return [String] The billing descriptor that appears on the payer's bank
|
|
26
|
+
# statement. [Required] max 25 characters.
|
|
27
|
+
# @!attribute customer_email
|
|
28
|
+
# @return [String] The email address of the payer that the pre-notification is
|
|
29
|
+
# sent to. [Required] Format: email
|
|
30
|
+
# @!attribute support_email
|
|
31
|
+
# @return [String] The support email address included in the pre-notification.
|
|
32
|
+
# [Required] Format: email
|
|
33
|
+
# @!attribute reference
|
|
34
|
+
# @return [String] A reference you can use to identify the collection.
|
|
35
|
+
# [Optional] max 50 characters.
|
|
36
|
+
# @!attribute support_phone
|
|
37
|
+
# @return [String] The support phone number included in the pre-notification,
|
|
38
|
+
# in E.164 format. [Optional]
|
|
39
|
+
class BacsNotificationRequest
|
|
40
|
+
attr_accessor :source_id,
|
|
41
|
+
:notification_type,
|
|
42
|
+
:collection_date,
|
|
43
|
+
:amount,
|
|
44
|
+
:currency,
|
|
45
|
+
:billing_descriptor,
|
|
46
|
+
:customer_email,
|
|
47
|
+
:support_email,
|
|
48
|
+
:reference,
|
|
49
|
+
:support_phone
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -73,6 +73,8 @@ module CheckoutSdk
|
|
|
73
73
|
# @return [CheckoutSdk::Identities::IdentityVerification::IdentityVerificationClient]
|
|
74
74
|
# @!attribute face_authentication
|
|
75
75
|
# @return [CheckoutSdk::Identities::FaceAuthentication::FaceAuthenticationClient]
|
|
76
|
+
# @!attribute bacs
|
|
77
|
+
# @return [CheckoutSdk::Apm::BacsClient]
|
|
76
78
|
# @!attribute apple_pay
|
|
77
79
|
# @return [CheckoutSdk::Payments::ApplePayClient]
|
|
78
80
|
# @!attribute google_pay
|
|
@@ -91,6 +93,7 @@ module CheckoutSdk
|
|
|
91
93
|
:sessions,
|
|
92
94
|
:tokens,
|
|
93
95
|
:ideal,
|
|
96
|
+
:bacs,
|
|
94
97
|
:accounts,
|
|
95
98
|
:workflows,
|
|
96
99
|
:risk,
|
|
@@ -131,6 +134,7 @@ module CheckoutSdk
|
|
|
131
134
|
@sessions = CheckoutSdk::Sessions::SessionsClient.new api_client, configuration
|
|
132
135
|
@tokens = CheckoutSdk::Tokens::TokensClient.new api_client, configuration
|
|
133
136
|
@ideal = CheckoutSdk::Apm::IdealClient.new api_client, configuration
|
|
137
|
+
@bacs = CheckoutSdk::Apm::BacsClient.new api_client, configuration
|
|
134
138
|
@workflows = CheckoutSdk::Workflows::WorkflowsClient.new api_client, configuration
|
|
135
139
|
@accounts = CheckoutSdk::Accounts::AccountsClient.new(api_client, files_client(configuration), configuration)
|
|
136
140
|
@risk = CheckoutSdk::Risk::RiskClient.new api_client, configuration
|
|
@@ -2,9 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Common
|
|
5
|
+
# The type of account holder.
|
|
6
|
+
#
|
|
7
|
+
# For stored instruments use {CheckoutSdk::Instruments::InstrumentAccountHolderType},
|
|
8
|
+
# whose schemas declare individual and corporate only.
|
|
5
9
|
module AccountHolderType
|
|
6
10
|
INDIVIDUAL = 'individual'
|
|
7
11
|
CORPORATE = 'corporate'
|
|
12
|
+
|
|
13
|
+
# Declared by the account-holder positions (AccountHolder, AccountHolderAch,
|
|
14
|
+
# PaymentSetupAccountHolder, RefundDestinationAccountHolder and the card-payout
|
|
15
|
+
# destination and sender) but **not** by any sender schema -
|
|
16
|
+
# PaymentRequestSender, PayoutSender, PaymentDetailsResponseSender and
|
|
17
|
+
# PaymentInterfacesSender all omit it. Do not send it as a sender type.
|
|
18
|
+
GOVERNMENT = 'government'
|
|
19
|
+
|
|
20
|
+
# Declared only by the payment and payout *sender* schemas
|
|
21
|
+
# (PaymentRequestSender, PayoutSender, PaymentDetailsResponseSender), never by
|
|
22
|
+
# an account-holder position. Retained rather than removed because removal is
|
|
23
|
+
# breaking; prefer the sender-specific type where one exists.
|
|
8
24
|
INSTRUMENT = 'instrument'
|
|
9
25
|
end
|
|
10
26
|
end
|
|
@@ -2,18 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Common
|
|
5
|
+
# The customer's details.
|
|
6
|
+
#
|
|
7
|
+
# This type serves two positions with different property sets. The payments
|
|
8
|
+
# position (swagger `CustomerRequest`) declares all six properties below. The
|
|
9
|
+
# instrument position (swagger `StoreCustomerInstrumentRequest`, used by
|
|
10
|
+
# {CheckoutSdk::Instruments::InstrumentBacs}, {CheckoutSdk::Instruments::InstrumentSepa}
|
|
11
|
+
# and {CheckoutSdk::Instruments::InstrumentAch}) declares every property except
|
|
12
|
+
# tax_number - do not send tax_number when storing an instrument.
|
|
13
|
+
#
|
|
5
14
|
# @!attribute id
|
|
6
15
|
# @return [String]
|
|
7
16
|
# @!attribute email
|
|
8
17
|
# @return [String]
|
|
9
18
|
# @!attribute name
|
|
10
|
-
# @return [String]
|
|
19
|
+
# @return [String] Only sets the name for *new* customers.
|
|
11
20
|
# @!attribute tax_number
|
|
12
|
-
# @return [String]
|
|
21
|
+
# @return [String] Payments position only. Not declared by
|
|
22
|
+
# StoreCustomerInstrumentRequest.
|
|
13
23
|
# @!attribute phone
|
|
14
24
|
# @return [Phone]
|
|
15
25
|
# @!attribute default
|
|
16
|
-
# @return [TrueClass, FalseClass]
|
|
26
|
+
# @return [TrueClass, FalseClass] If true, this instrument becomes the default
|
|
27
|
+
# for the customer. An instrument is automatically the default when the
|
|
28
|
+
# request creates a new customer.
|
|
17
29
|
class CustomerRequest
|
|
18
30
|
attr_accessor :id,
|
|
19
31
|
:email,
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Common
|
|
5
|
+
# The type of a payment instrument.
|
|
5
6
|
module InstrumentType
|
|
6
7
|
BANK_ACCOUNT = 'bank_account'
|
|
7
8
|
TOKEN = 'token'
|
|
8
9
|
CARD = 'card'
|
|
9
10
|
SEPA = 'sepa'
|
|
11
|
+
|
|
12
|
+
# Current API (NAS) only. The previous API (ABC) instrument schemas declare
|
|
13
|
+
# neither of these, so do not use them with a previous-platform client.
|
|
14
|
+
ACH = 'ach'
|
|
15
|
+
BACS = 'bacs'
|
|
16
|
+
|
|
17
|
+
# Previous API (ABC) only. Not declared by any current-API instrument schema.
|
|
10
18
|
CARD_TOKEN = 'card_token'
|
|
11
19
|
end
|
|
12
20
|
end
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Common
|
|
5
|
+
# The type of a payment source or destination.
|
|
6
|
+
#
|
|
7
|
+
# This module is shared by the current API (NAS) and the previous API (ABC),
|
|
8
|
+
# which is still actively maintained. These 22 values are declared by neither
|
|
9
|
+
# `PaymentRequestSourceType` nor `PaymentDetailsResponseSourceType` in the
|
|
10
|
+
# current specification and are **previous API (ABC) only**:
|
|
11
|
+
#
|
|
12
|
+
# afterpay, alipay, applepay, baloto, bank_account, benefit, benefitpay,
|
|
13
|
+
# boleto, cvconnect, dlocal, giropay, googlepay, illicado, oxxo, pagofacil,
|
|
14
|
+
# poli, postfinance, provider_token, rapipago, sofort, tabby, trustly
|
|
15
|
+
#
|
|
16
|
+
# Use them only with a previous-platform client. Every other value below is
|
|
17
|
+
# current-API.
|
|
5
18
|
module PaymentSourceType
|
|
6
19
|
CARD = 'card'
|
|
7
20
|
ID = 'id'
|
|
@@ -54,10 +67,16 @@ module CheckoutSdk
|
|
|
54
67
|
ILLICADO = 'illicado'
|
|
55
68
|
SEPA = 'sepa'
|
|
56
69
|
ACH = 'ach'
|
|
70
|
+
BACS = 'bacs'
|
|
57
71
|
BIZUM = 'bizum'
|
|
58
72
|
OCTOPUS = 'octopus'
|
|
59
73
|
PLAID = 'plaid'
|
|
60
74
|
SEQURA = 'sequra'
|
|
75
|
+
MOBILEPAY = 'mobilepay'
|
|
76
|
+
PAYNOW = 'paynow'
|
|
77
|
+
SWISH = 'swish'
|
|
78
|
+
TWINT = 'twint'
|
|
79
|
+
VIPPS = 'vipps'
|
|
61
80
|
TABBY = 'tabby'
|
|
62
81
|
APPLEPAY = 'applepay'
|
|
63
82
|
GOOGLEPAY = 'googlepay'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The type of Direct Debit account on an ACH instrument.
|
|
6
|
+
#
|
|
7
|
+
# The ACH instrument schemas declare savings and checking only. The ACH payment
|
|
8
|
+
# source additionally declares cash - see {CheckoutSdk::Common::AccountType}.
|
|
9
|
+
module AchAccountType
|
|
10
|
+
SAVINGS = 'savings'
|
|
11
|
+
CHECKING = 'checking'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The type of payment on a Bacs Direct Debit instrument.
|
|
6
|
+
#
|
|
7
|
+
# Declared capitalized by the Bacs instrument schemas, unlike {SepaPaymentType}
|
|
8
|
+
# which declares the same two concepts lowercase. The casing is not
|
|
9
|
+
# interchangeable and must not be unified.
|
|
10
|
+
module BacsPaymentType
|
|
11
|
+
RECURRING = 'Recurring'
|
|
12
|
+
REGULAR = 'Regular'
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The account holder details of an ACH instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# The specification lists all four properties in the schema's required array,
|
|
8
|
+
# while the individual field descriptions make them conditional on type
|
|
9
|
+
# ("Required for individual account holder type" / "Required for corporate
|
|
10
|
+
# account holder type"). The two readings contradict each other; send the pair
|
|
11
|
+
# that matches your type value.
|
|
12
|
+
#
|
|
13
|
+
# @!attribute first_name
|
|
14
|
+
# @return [String] First name. Required for individual account holder type.
|
|
15
|
+
# @!attribute last_name
|
|
16
|
+
# @return [String] Last name. Required for individual account holder type.
|
|
17
|
+
# @!attribute company_name
|
|
18
|
+
# @return [String] Company name. Required for corporate account holder type.
|
|
19
|
+
# @!attribute type
|
|
20
|
+
# @return [String] {InstrumentAccountHolderType} Account holder type.
|
|
21
|
+
# [Required]
|
|
22
|
+
class CreateAchAccountHolder
|
|
23
|
+
attr_accessor :first_name,
|
|
24
|
+
:last_name,
|
|
25
|
+
:company_name,
|
|
26
|
+
:type
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The details of the bank account of an ACH instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute account_type
|
|
8
|
+
# @return [String] {AchAccountType} The type of Direct Debit account,
|
|
9
|
+
# savings or checking. [Required]
|
|
10
|
+
# @!attribute account_number
|
|
11
|
+
# @return [String] The account number of the Direct Debit account.
|
|
12
|
+
# [Required] min 4 characters, max 17 characters.
|
|
13
|
+
# @!attribute bank_code
|
|
14
|
+
# @return [String] The bank code of the Direct Debit account.
|
|
15
|
+
# [Required] min 8 characters, max 9 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 country
|
|
20
|
+
# @return [String] {CheckoutSdk::Common::Country} The country of the account.
|
|
21
|
+
# [Required] min 2 characters, max 2 characters.
|
|
22
|
+
class CreateAchInstrumentData
|
|
23
|
+
attr_accessor :account_type,
|
|
24
|
+
:account_number,
|
|
25
|
+
:bank_code,
|
|
26
|
+
:currency,
|
|
27
|
+
:country
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The account holder details of a Bacs Direct Debit instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# The store shape declares three properties only. The update and retrieve shapes
|
|
8
|
+
# additionally declare company_name and type - see
|
|
9
|
+
# {UpdateBacsAccountHolder}.
|
|
10
|
+
#
|
|
11
|
+
# @!attribute first_name
|
|
12
|
+
# @return [String] The first name of the account holder. [Required]
|
|
13
|
+
# @!attribute last_name
|
|
14
|
+
# @return [String] The last name of the account holder. [Required]
|
|
15
|
+
# @!attribute billing_address
|
|
16
|
+
# @return [CreateBacsBillingAddress] The billing address of the account
|
|
17
|
+
# holder. [Required]
|
|
18
|
+
class CreateBacsAccountHolder
|
|
19
|
+
attr_accessor :first_name,
|
|
20
|
+
:last_name,
|
|
21
|
+
:billing_address
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The billing address of the account holder of a Bacs Direct Debit instrument
|
|
6
|
+
# being stored.
|
|
7
|
+
#
|
|
8
|
+
# @!attribute address_line1
|
|
9
|
+
# @return [String] The first line of the address. [Optional] max 200 characters.
|
|
10
|
+
# @!attribute address_line2
|
|
11
|
+
# @return [String] The street number. If no number, pass "w/n".
|
|
12
|
+
# [Optional] max 10 characters.
|
|
13
|
+
# @!attribute city
|
|
14
|
+
# @return [String] The address city. [Optional] max 35 characters.
|
|
15
|
+
# Note the update variant allows max 50.
|
|
16
|
+
# @!attribute zip
|
|
17
|
+
# @return [String] The address zip/postal code. [Optional] max 16 characters.
|
|
18
|
+
# Note the update variant allows max 50.
|
|
19
|
+
# @!attribute country
|
|
20
|
+
# @return [String] {CheckoutSdk::Common::Country} The two-letter ISO country
|
|
21
|
+
# code of the address. [Required] min 2 characters, max 2 characters.
|
|
22
|
+
class CreateBacsBillingAddress
|
|
23
|
+
attr_accessor :address_line1,
|
|
24
|
+
:address_line2,
|
|
25
|
+
:city,
|
|
26
|
+
:zip,
|
|
27
|
+
:country
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The account configuration of a Bacs Direct Debit instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute processing_channel_id
|
|
8
|
+
# @return [String] The ID of the processing channel to associate with the
|
|
9
|
+
# instrument. [Required] Pattern: ^(pc)_(\w{26})$
|
|
10
|
+
class CreateBacsInstrumentAccount
|
|
11
|
+
attr_accessor :processing_channel_id
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The details of a Bacs Direct Debit account being stored.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute account_number
|
|
8
|
+
# @return [String] The account number of the Bacs Direct Debit account.
|
|
9
|
+
# [Required] min 8 characters, max 8 characters.
|
|
10
|
+
# @!attribute bank_code
|
|
11
|
+
# @return [String] The sort code of the Bacs Direct Debit account.
|
|
12
|
+
# [Required] min 6 characters, max 6 characters.
|
|
13
|
+
# @!attribute country
|
|
14
|
+
# @return [String] {CheckoutSdk::Common::Country} The country of the account,
|
|
15
|
+
# as an ISO 3166-1 alpha-2 code. [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] {BacsPaymentType} The type of payment, Recurring or
|
|
21
|
+
# Regular. [Required] Capitalized, unlike the SEPA equivalent.
|
|
22
|
+
# @!attribute allow_partial_match
|
|
23
|
+
# @return [TrueClass, FalseClass] Indicates whether the Bacs instrument is
|
|
24
|
+
# created when account validation returns a partial match. When true the
|
|
25
|
+
# instrument is created on a partial match; when false instrument creation
|
|
26
|
+
# fails on a partial match. [Optional] Default: false
|
|
27
|
+
class CreateBacsInstrumentData
|
|
28
|
+
attr_accessor :account_number,
|
|
29
|
+
:bank_code,
|
|
30
|
+
:country,
|
|
31
|
+
:currency,
|
|
32
|
+
:payment_type,
|
|
33
|
+
:allow_partial_match
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The account holder details of a SEPA instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute first_name
|
|
8
|
+
# @return [String] The first name of the account holder. [Required]
|
|
9
|
+
# @!attribute last_name
|
|
10
|
+
# @return [String] The last name of the account holder. [Required]
|
|
11
|
+
# @!attribute billing_address
|
|
12
|
+
# @return [CreateSepaBillingAddress] The billing address of the account
|
|
13
|
+
# holder. [Required]
|
|
14
|
+
# @!attribute company_name
|
|
15
|
+
# @return [String] The legal name of a registered company that holds the
|
|
16
|
+
# account. [Optional] max 50 characters.
|
|
17
|
+
# @!attribute type
|
|
18
|
+
# @return [String] {InstrumentAccountHolderType} The type of account holder.
|
|
19
|
+
# [Optional]
|
|
20
|
+
class CreateSepaAccountHolder
|
|
21
|
+
attr_accessor :first_name,
|
|
22
|
+
:last_name,
|
|
23
|
+
:billing_address,
|
|
24
|
+
:company_name,
|
|
25
|
+
:type
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
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 stored.
|
|
6
|
+
#
|
|
7
|
+
# Every property is required on this shape.
|
|
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 35 characters.
|
|
16
|
+
# Note the update variant allows max 50.
|
|
17
|
+
# @!attribute zip
|
|
18
|
+
# @return [String] The address zip/postal code. [Required] max 16 characters.
|
|
19
|
+
# Note the update variant allows max 50.
|
|
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 CreateSepaBillingAddress
|
|
24
|
+
attr_accessor :address_line1,
|
|
25
|
+
:address_line2,
|
|
26
|
+
:city,
|
|
27
|
+
:zip,
|
|
28
|
+
:country
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# The details of the mandate of a SEPA instrument being stored.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute account_number
|
|
8
|
+
# @return [String] The International Bank Account Number (IBAN) of the
|
|
9
|
+
# account. [Required] min 15 characters, max 34 characters.
|
|
10
|
+
# @!attribute country
|
|
11
|
+
# @return [String] {CheckoutSdk::Common::Country} The country of the account.
|
|
12
|
+
# [Required] min 2 characters, max 2 characters.
|
|
13
|
+
# @!attribute currency
|
|
14
|
+
# @return [String] {CheckoutSdk::Common::Currency} The currency of the account.
|
|
15
|
+
# [Required] min 3 characters, max 3 characters.
|
|
16
|
+
# @!attribute payment_type
|
|
17
|
+
# @return [String] {SepaPaymentType} The type of payment, recurring or
|
|
18
|
+
# regular. [Required] Lowercase, unlike the Bacs equivalent.
|
|
19
|
+
# @!attribute type
|
|
20
|
+
# @return [String] {SepaMandateType} The type of mandate, Core or B2B.
|
|
21
|
+
# [Optional]
|
|
22
|
+
# @!attribute mandate_id
|
|
23
|
+
# @return [String] The mandate ID. If a mandate ID is not provided, a new,
|
|
24
|
+
# random mandate ID will be generated. [Optional] min 1 character,
|
|
25
|
+
# max 35 characters.
|
|
26
|
+
# @!attribute date_of_signature
|
|
27
|
+
# @return [String] The date on which the mandate was signed, in the format
|
|
28
|
+
# yyyy-MM-dd. Required if mandate_id is provided. [Optional]
|
|
29
|
+
# Format: date - pass a yyyy-MM-dd String, not a DateTime.
|
|
30
|
+
class CreateSepaInstrumentData
|
|
31
|
+
attr_accessor :account_number,
|
|
32
|
+
:country,
|
|
33
|
+
:currency,
|
|
34
|
+
:payment_type,
|
|
35
|
+
:type,
|
|
36
|
+
:mandate_id,
|
|
37
|
+
:date_of_signature
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# Store ACH bank account details.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute instrument_data
|
|
8
|
+
# @return [CreateAchInstrumentData] The details of the bank account.
|
|
9
|
+
# [Required]
|
|
10
|
+
# @!attribute account_holder
|
|
11
|
+
# @return [CreateAchAccountHolder] The account holder details. [Required]
|
|
12
|
+
# @!attribute customer
|
|
13
|
+
# @return [CheckoutSdk::Common::CustomerRequest] The customer's details.
|
|
14
|
+
# [Optional]
|
|
15
|
+
class InstrumentAch < Instrument
|
|
16
|
+
attr_accessor :instrument_data,
|
|
17
|
+
:account_holder,
|
|
18
|
+
:customer
|
|
19
|
+
|
|
20
|
+
def initialize
|
|
21
|
+
super(CheckoutSdk::Common::InstrumentType::ACH)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Instruments
|
|
5
|
+
# Store Bacs Direct Debit account details.
|
|
6
|
+
#
|
|
7
|
+
# @!attribute account
|
|
8
|
+
# @return [CreateBacsInstrumentAccount] The account configuration for the
|
|
9
|
+
# instrument. [Required]
|
|
10
|
+
# @!attribute instrument_data
|
|
11
|
+
# @return [CreateBacsInstrumentData] The details of the Bacs Direct Debit
|
|
12
|
+
# account. [Required]
|
|
13
|
+
# @!attribute account_holder
|
|
14
|
+
# @return [CreateBacsAccountHolder] The account holder details. [Required]
|
|
15
|
+
# @!attribute customer
|
|
16
|
+
# @return [CheckoutSdk::Common::CustomerRequest] The customer's details.
|
|
17
|
+
# [Optional]
|
|
18
|
+
class InstrumentBacs < Instrument
|
|
19
|
+
attr_accessor :account,
|
|
20
|
+
:instrument_data,
|
|
21
|
+
:account_holder,
|
|
22
|
+
:customer
|
|
23
|
+
|
|
24
|
+
def initialize
|
|
25
|
+
super(CheckoutSdk::Common::InstrumentType::BACS)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Instruments
|
|
5
|
+
# Store SEPA account details.
|
|
6
|
+
#
|
|
5
7
|
# @!attribute instrument_data
|
|
6
|
-
# @return [
|
|
8
|
+
# @return [CreateSepaInstrumentData] The details of the mandate. [Required]
|
|
7
9
|
# @!attribute account_holder
|
|
8
|
-
# @return [
|
|
10
|
+
# @return [CreateSepaAccountHolder] The account holder details. [Required]
|
|
11
|
+
# @!attribute customer
|
|
12
|
+
# @return [CheckoutSdk::Common::CustomerRequest] The customer's details.
|
|
13
|
+
# [Optional]
|
|
9
14
|
class InstrumentSepa < Instrument
|
|
10
15
|
attr_accessor :instrument_data,
|
|
11
|
-
:account_holder
|
|
16
|
+
:account_holder,
|
|
17
|
+
:customer
|
|
12
18
|
|
|
13
19
|
def initialize
|
|
14
20
|
super(CheckoutSdk::Common::InstrumentType::SEPA)
|