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.
- 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/balances/balances.rb +3 -0
- data/lib/checkout_sdk/balances/balances_client.rb +37 -3
- data/lib/checkout_sdk/balances/top_up_bank_details.rb +22 -0
- data/lib/checkout_sdk/balances/top_up_funding_details.rb +53 -0
- data/lib/checkout_sdk/balances/top_up_instructions.rb +34 -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/json_serializer.rb +3 -1
- data/lib/checkout_sdk/oauth_scopes.rb +1 -0
- data/lib/checkout_sdk/payments/flow/flow_client.rb +6 -0
- data/lib/checkout_sdk/payments/payments.rb +22 -0
- data/lib/checkout_sdk/payments/setups/payment_setup_billing_descriptor.rb +19 -0
- data/lib/checkout_sdk/payments/setups/payment_setup_presentment_details.rb +17 -0
- data/lib/checkout_sdk/payments/setups/payment_setup_terminal.rb +16 -0
- data/lib/checkout_sdk/payments/setups/payment_setups_client.rb +11 -5
- 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 +57 -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: 8ab7d38f61ed5faeabcf716c00ead8f3863b96ead74abd6c3e2835617d8090c5
|
|
4
|
+
data.tar.gz: 70b87b4515f6084c189956b6e7d9360a4e96686e91a1bdc293207748302b9f21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15700b0fe9e01a5d21f8a4b88971c729de748f79b8d213a7e695575c492c4d1f61781e43075228695ee429b3d5172cb8475541fb41122acc17a19d82a7319422
|
|
7
|
+
data.tar.gz: 1d271293014b5535cb92b87cb7bff5b3ada0021dca9824560c432e0ece531ecdedfacff7ff8f312fe36eb9a285339d7f1bc04e8c8f51a9be998427b1f65933cb
|
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
|
|
@@ -4,4 +4,7 @@ require 'checkout_sdk/balances/balances_query'
|
|
|
4
4
|
require 'checkout_sdk/balances/collateral_breakdown'
|
|
5
5
|
require 'checkout_sdk/balances/balance_values'
|
|
6
6
|
require 'checkout_sdk/balances/currency_account_balance'
|
|
7
|
+
require 'checkout_sdk/balances/top_up_funding_details'
|
|
8
|
+
require 'checkout_sdk/balances/top_up_bank_details'
|
|
9
|
+
require 'checkout_sdk/balances/top_up_instructions'
|
|
7
10
|
require 'checkout_sdk/balances/balances_client'
|
|
@@ -4,7 +4,10 @@ module CheckoutSdk
|
|
|
4
4
|
module Balances
|
|
5
5
|
class BalancesClient < Client
|
|
6
6
|
BALANCES = 'balances'
|
|
7
|
-
|
|
7
|
+
ENTITIES = 'entities'
|
|
8
|
+
CURRENCY_ACCOUNTS = 'currency-accounts'
|
|
9
|
+
TOP_UP_INSTRUCTIONS = 'top-up-instructions'
|
|
10
|
+
private_constant :BALANCES, :ENTITIES, :CURRENCY_ACCOUNTS, :TOP_UP_INSTRUCTIONS
|
|
8
11
|
|
|
9
12
|
# @param [ApiClient] api_client
|
|
10
13
|
# @param [CheckoutConfiguration] configuration
|
|
@@ -12,11 +15,42 @@ module CheckoutSdk
|
|
|
12
15
|
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
13
16
|
end
|
|
14
17
|
|
|
15
|
-
#
|
|
16
|
-
#
|
|
18
|
+
# Retrieves the balances for each sub-account belonging to an entity.
|
|
19
|
+
#
|
|
20
|
+
# @param [String] entity_id the ID of the entity
|
|
21
|
+
# @param [String, BalancesQuery] balances_query a raw query string
|
|
22
|
+
# (e.g. "currency:GBP") or a {BalancesQuery}
|
|
23
|
+
# @return [Hash] the balances response
|
|
17
24
|
def retrieve_entity_balances(entity_id, balances_query)
|
|
18
25
|
api_client.invoke_get(build_path(BALANCES, entity_id), sdk_authorization, balances_query)
|
|
19
26
|
end
|
|
27
|
+
|
|
28
|
+
# Retrieves the bank details required to top up a sub-account, along with the payment
|
|
29
|
+
# reference that attributes an incoming payment to that sub-account.
|
|
30
|
+
#
|
|
31
|
+
# Note: The sub-account is referred to as currency account in the API.
|
|
32
|
+
#
|
|
33
|
+
# The response maps to {TopUpInstructions}, whose `bank_details` is a {TopUpBankDetails}
|
|
34
|
+
# holding up to two {TopUpFundingDetails} rails. Neither rail is guaranteed.
|
|
35
|
+
#
|
|
36
|
+
# @param [String] entity_id the ID of the entity that owns the sub-account, or of an entity
|
|
37
|
+
# above it in your hierarchy; a platform can use its own entity ID to reach the
|
|
38
|
+
# sub-accounts of any entity beneath it
|
|
39
|
+
# @param [String] currency_account_id the ID of the sub-account to retrieve top-up
|
|
40
|
+
# instructions for
|
|
41
|
+
# @return [Hash] the top-up instructions response
|
|
42
|
+
# @raise [CheckoutArgumentException] if either path parameter is nil, empty or blank. Both
|
|
43
|
+
# segments are interpolated straight into the request path, so a blank value would build a
|
|
44
|
+
# malformed URL and be rejected by the API rather than by the SDK.
|
|
45
|
+
def retrieve_top_up_instructions(entity_id, currency_account_id)
|
|
46
|
+
raise CheckoutArgumentException, 'entity_id cannot be blank' if entity_id.to_s.strip.empty?
|
|
47
|
+
raise CheckoutArgumentException, 'currency_account_id cannot be blank' if currency_account_id.to_s.strip.empty?
|
|
48
|
+
|
|
49
|
+
api_client.invoke_get(
|
|
50
|
+
build_path(ENTITIES, entity_id, CURRENCY_ACCOUNTS, currency_account_id, TOP_UP_INSTRUCTIONS),
|
|
51
|
+
sdk_authorization
|
|
52
|
+
)
|
|
53
|
+
end
|
|
20
54
|
end
|
|
21
55
|
end
|
|
22
56
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# The bank details for each available funding rail (swagger schema: TopUpBankDetails).
|
|
6
|
+
#
|
|
7
|
+
# Both `domestic` and `international` are optional, and their availability depends on the
|
|
8
|
+
# sub-account's holding currency, jurisdiction, and banking partner. Do not assume that both
|
|
9
|
+
# rails are always available; neither may be present.
|
|
10
|
+
#
|
|
11
|
+
# @!attribute domestic
|
|
12
|
+
# [Optional]
|
|
13
|
+
# @return [TopUpFundingDetails] The bank details for the domestic funding rail.
|
|
14
|
+
# @!attribute international
|
|
15
|
+
# [Optional]
|
|
16
|
+
# @return [TopUpFundingDetails] The bank details for the international funding rail.
|
|
17
|
+
class TopUpBankDetails
|
|
18
|
+
attr_accessor :domestic,
|
|
19
|
+
:international
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# The bank details for a single funding rail (swagger schema: TopUpFundingDetails).
|
|
6
|
+
#
|
|
7
|
+
# `beneficiary_account_name` and `bank_name` are the only fields always returned. The
|
|
8
|
+
# remaining fields vary by rail and the receiving bank's jurisdiction, and are omitted when
|
|
9
|
+
# they do not apply.
|
|
10
|
+
#
|
|
11
|
+
# @!attribute beneficiary_account_name
|
|
12
|
+
# [Required]
|
|
13
|
+
# @return [String] The name of the account that receives the funds.
|
|
14
|
+
# @!attribute beneficiary_address
|
|
15
|
+
# [Optional]
|
|
16
|
+
# @return [String] The address of the beneficiary, if the rail requires it.
|
|
17
|
+
# @!attribute bank_name
|
|
18
|
+
# [Required]
|
|
19
|
+
# @return [String] The name of the bank that receives the funds.
|
|
20
|
+
# @!attribute bank_address
|
|
21
|
+
# [Optional]
|
|
22
|
+
# @return [String] The address of the receiving bank, if the rail requires it.
|
|
23
|
+
# @!attribute account_number
|
|
24
|
+
# [Optional]
|
|
25
|
+
# @return [String] The account number of the receiving account.
|
|
26
|
+
# @!attribute sort_code
|
|
27
|
+
# [Optional]
|
|
28
|
+
# @return [String] The sort code of the receiving bank. Returned for United Kingdom
|
|
29
|
+
# domestic transfers.
|
|
30
|
+
# @!attribute routing_number
|
|
31
|
+
# [Optional]
|
|
32
|
+
# @return [String] The routing number of the receiving bank. Returned for United States
|
|
33
|
+
# domestic transfers.
|
|
34
|
+
# @!attribute iban
|
|
35
|
+
# [Optional]
|
|
36
|
+
# @return [String] The International Bank Account Number of the receiving account.
|
|
37
|
+
# @!attribute swift_code
|
|
38
|
+
# [Optional]
|
|
39
|
+
# @return [String] The SWIFT or BIC code of the receiving bank. Returned for
|
|
40
|
+
# international transfers.
|
|
41
|
+
class TopUpFundingDetails
|
|
42
|
+
attr_accessor :beneficiary_account_name,
|
|
43
|
+
:beneficiary_address,
|
|
44
|
+
:bank_name,
|
|
45
|
+
:bank_address,
|
|
46
|
+
:account_number,
|
|
47
|
+
:sort_code,
|
|
48
|
+
:routing_number,
|
|
49
|
+
:iban,
|
|
50
|
+
:swift_code
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Balances
|
|
5
|
+
# The bank details and payment reference used to top up a sub-account
|
|
6
|
+
# (swagger schema: TopUpInstructionsResponse).
|
|
7
|
+
#
|
|
8
|
+
# Returned by
|
|
9
|
+
# GET /entities/{entityId}/currency-accounts/{currencyAccountId}/top-up-instructions.
|
|
10
|
+
#
|
|
11
|
+
# @!attribute currency_account_id
|
|
12
|
+
# [Required]
|
|
13
|
+
# @return [String] The unique identifier of the sub-account that the instructions apply to.
|
|
14
|
+
# @!attribute currency
|
|
15
|
+
# [Required]
|
|
16
|
+
# @return [String] {CheckoutSdk::Common::Currency} The currency that funds must be sent in,
|
|
17
|
+
# as a three-letter ISO 4217 currency code. This is the sub-account's holding currency,
|
|
18
|
+
# returned as `holding_currency` by the Retrieve entity balances endpoint.
|
|
19
|
+
# @!attribute payment_reference
|
|
20
|
+
# [Required]
|
|
21
|
+
# @return [String] The reference that must be quoted on the payment. It is how an incoming
|
|
22
|
+
# payment is attributed to the sub-account. A payment sent without this reference may not
|
|
23
|
+
# be credited.
|
|
24
|
+
# @!attribute bank_details
|
|
25
|
+
# [Required]
|
|
26
|
+
# @return [TopUpBankDetails] The bank details for each available funding rail.
|
|
27
|
+
class TopUpInstructions
|
|
28
|
+
attr_accessor :currency_account_id,
|
|
29
|
+
:currency,
|
|
30
|
+
:payment_reference,
|
|
31
|
+
:bank_details
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
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
|