checkout_sdk 1.11.0 → 2.0.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/README.md +24 -1
- data/lib/checkout_sdk/abstract_checkout_sdk_builder.rb +55 -4
- data/lib/checkout_sdk/accounts/accounts.rb +1 -0
- data/lib/checkout_sdk/accounts/instrument_document_type.rb +17 -0
- data/lib/checkout_sdk/accounts/schedule_frequency_daily.rb +2 -0
- data/lib/checkout_sdk/accounts/schedule_frequency_monthly.rb +3 -1
- data/lib/checkout_sdk/accounts/schedule_frequency_weekly.rb +3 -1
- data/lib/checkout_sdk/accounts/update_schedule.rb +11 -0
- data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +23 -10
- data/lib/checkout_sdk/checkout_static_keys_sdk_builder.rb +2 -1
- data/lib/checkout_sdk/environment_subdomain.rb +22 -23
- data/lib/checkout_sdk/payments/processing_data.rb +90 -7
- data/lib/checkout_sdk/payments/void_request.rb +5 -1
- data/lib/checkout_sdk/previous/checkout_previous_static_keys_sdk_builder.rb +8 -1
- data/lib/checkout_sdk/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c470151f96c3425b61e6c49458a3612daf2174cf3b69e92861c5932dacfe5879
|
|
4
|
+
data.tar.gz: 2201bb66edace8b6b24edb4e84decf122dde349e6418c268e68dacdb1d8239b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d28b90870372311da801cb4c93f3fd16933b8ee79f43954bb837c8d30f82fe2ddef2ed965a41a81611a32263bf11d2778c8f21f49c8031d0b977b9aad2d15ce
|
|
7
|
+
data.tar.gz: d2a7438c35e5815e9be95804597218ae62d7a967e92ef6285f749110a77d82cead49c1933d88994551822547ea59ce5ee41b3466f2b0773569ac11eada4dd663
|
data/README.md
CHANGED
|
@@ -69,6 +69,10 @@ account [here](https://www.checkout.com/get-test-account).
|
|
|
69
69
|
|
|
70
70
|
**PLEASE NEVER SHARE OR PUBLISH YOUR CHECKOUT CREDENTIALS.**
|
|
71
71
|
|
|
72
|
+
### Subdomain value
|
|
73
|
+
|
|
74
|
+
Requests must be made through your merchant-specific subdomain (MSSD): the first 8 characters of your client ID (excluding `cli_`). For example, if your client ID is `cli_vkuhvk4vjn2edkps7dfsq6emqm`, your subdomain is `vkuhvk4v`. When `with_environment_subdomain` is set the SDK sends requests to `https://vkuhvk4v.api.checkout.com`. See [Base URLs](https://api-reference.checkout.com/#section/Base-URLs) and [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints) for further details, and for where to find your unique client ID. Private Link merchants use their `pl-` prefixed subdomain (for example `pl-vkuhvk4v`), which the SDK also accepts.
|
|
75
|
+
|
|
72
76
|
### Default
|
|
73
77
|
|
|
74
78
|
Default keys client instantiation can be done as follows:
|
|
@@ -79,6 +83,7 @@ api = CheckoutSdk.builder
|
|
|
79
83
|
.with_secret_key('secret_key')
|
|
80
84
|
.with_public_key('public_key') # optional, only required for operations related with tokens
|
|
81
85
|
.with_environment(CheckoutSdk::Environment.sandbox)
|
|
86
|
+
.with_environment_subdomain('subdomain') # required, the first 8 characters of your client ID
|
|
82
87
|
.build
|
|
83
88
|
```
|
|
84
89
|
|
|
@@ -89,10 +94,10 @@ The SDK supports client credentials OAuth, when initialized as follows:
|
|
|
89
94
|
```ruby
|
|
90
95
|
api = CheckoutSdk.builder
|
|
91
96
|
.oauth
|
|
92
|
-
.with_authorization_uri('https://access.sandbox.checkout.com/connect/token') # custom authorization URI, optional
|
|
93
97
|
.with_client_credentials("client_id", "client_secret")
|
|
94
98
|
.with_scopes([CheckoutSdk::OAuthScopes::VAULT, CheckoutSdk::OAuthScopes::GATEWAY]) # array of scopes
|
|
95
99
|
.with_environment(CheckoutSdk::Environment.sandbox)
|
|
100
|
+
.with_environment_subdomain('subdomain') # required, the first 8 characters of your client ID
|
|
96
101
|
.build
|
|
97
102
|
```
|
|
98
103
|
|
|
@@ -107,6 +112,7 @@ api = CheckoutSdk.builder
|
|
|
107
112
|
.with_secret_key('secret_key')
|
|
108
113
|
.with_public_key('public_key') # optional, only required for operations related with tokens
|
|
109
114
|
.with_environment(CheckoutSdk::Environment.sandbox)
|
|
115
|
+
.with_environment_subdomain('subdomain') # optional for the Previous platform
|
|
110
116
|
.build
|
|
111
117
|
```
|
|
112
118
|
|
|
@@ -267,6 +273,23 @@ If you absolutely need to skip the pre-commit hooks:
|
|
|
267
273
|
OVERCOMMIT_DISABLE=1 git commit -m "your message"
|
|
268
274
|
```
|
|
269
275
|
|
|
276
|
+
## Legacy domain (emergency use only)
|
|
277
|
+
|
|
278
|
+
> :warning: **Only use if merchant specific sub domains are causing issues.** Connecting through your merchant-specific subdomain (see [Subdomain value](#subdomain-value)) is the supported way of using the Checkout.com API, and non-subdomain usage will be deprecated.
|
|
279
|
+
|
|
280
|
+
If, in exceptional circumstances, you cannot use your merchant-specific subdomain, you can explicitly opt out by calling `with_legacy_domain` instead of `with_environment_subdomain`:
|
|
281
|
+
|
|
282
|
+
```ruby
|
|
283
|
+
api = CheckoutSdk.builder
|
|
284
|
+
.static_keys
|
|
285
|
+
.with_secret_key('secret_key')
|
|
286
|
+
.with_environment(CheckoutSdk::Environment.sandbox)
|
|
287
|
+
.with_legacy_domain # deprecated, emergency fallback only
|
|
288
|
+
.build
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
This routes requests to `api.checkout.com` (or `api.sandbox.checkout.com`) and `access.checkout.com` (or `access.sandbox.checkout.com`). The method prints a deprecation warning. Exactly one of `with_environment_subdomain` or `with_legacy_domain` must be set: the SDK raises a `CheckoutSdk::CheckoutArgumentException` if both, or neither, are. The Previous (ABC) platform predates merchant-specific subdomains and is exempt from this requirement.
|
|
292
|
+
|
|
270
293
|
## Code of Conduct
|
|
271
294
|
|
|
272
295
|
Please refer to [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
@@ -8,9 +8,13 @@ module CheckoutSdk
|
|
|
8
8
|
# @return [Faraday::Connection]
|
|
9
9
|
# @!attribute multipart_http_client
|
|
10
10
|
# @return [Faraday::Connection]
|
|
11
|
-
# @!attribute
|
|
12
|
-
# @return [
|
|
13
|
-
attr_accessor :environment, :http_client, :multipart_http_client, :logger, :
|
|
11
|
+
# @!attribute subdomain
|
|
12
|
+
# @return [String, nil]
|
|
13
|
+
attr_accessor :environment, :http_client, :multipart_http_client, :logger, :subdomain
|
|
14
|
+
|
|
15
|
+
def initialize
|
|
16
|
+
@use_legacy_domain = false
|
|
17
|
+
end
|
|
14
18
|
|
|
15
19
|
# @param [Environment] environment
|
|
16
20
|
def with_environment(environment)
|
|
@@ -37,11 +41,41 @@ module CheckoutSdk
|
|
|
37
41
|
|
|
38
42
|
# @param [String, nil] subdomain
|
|
39
43
|
def with_environment_subdomain(subdomain)
|
|
40
|
-
@
|
|
44
|
+
@subdomain = subdomain
|
|
45
|
+
self
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Opts out of the merchant-specific subdomain, sending every request to the shared hosts
|
|
49
|
+
# instead (api.checkout.com and access.checkout.com, or their sandbox equivalents).
|
|
50
|
+
#
|
|
51
|
+
# @deprecated This is an emergency fallback for the rare case where the merchant-specific
|
|
52
|
+
# subdomain cannot be used, and will be removed in a future release. Call
|
|
53
|
+
# {#with_environment_subdomain} instead.
|
|
54
|
+
# See https://api-reference.checkout.com/#section/Base-URLs
|
|
55
|
+
def with_legacy_domain
|
|
56
|
+
warn '[DEPRECATION] with_legacy_domain is deprecated and will be removed in a future ' \
|
|
57
|
+
'release. It is intended only as an emergency fallback when the merchant-specific ' \
|
|
58
|
+
'subdomain cannot be used. Call with_environment_subdomain instead. ' \
|
|
59
|
+
'See https://api-reference.checkout.com/#section/Base-URLs'
|
|
60
|
+
@use_legacy_domain = true
|
|
41
61
|
self
|
|
42
62
|
end
|
|
43
63
|
|
|
64
|
+
# @return [EnvironmentSubdomain, nil]
|
|
65
|
+
def environment_subdomain
|
|
66
|
+
return nil if subdomain.nil?
|
|
67
|
+
|
|
68
|
+
EnvironmentSubdomain.new(environment, subdomain)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Whether this builder requires the merchant-specific subdomain to be configured. The
|
|
72
|
+
# Previous (ABC) platform predates merchant-specific subdomains, so it overrides this.
|
|
73
|
+
def requires_environment_subdomain?
|
|
74
|
+
true
|
|
75
|
+
end
|
|
76
|
+
|
|
44
77
|
def build
|
|
78
|
+
validate_environment_settings
|
|
45
79
|
with_environment(Environment.sandbox) if environment.nil?
|
|
46
80
|
if http_client.nil?
|
|
47
81
|
@http_client = CheckoutUtils.build_default_client
|
|
@@ -59,5 +93,22 @@ module CheckoutSdk
|
|
|
59
93
|
end
|
|
60
94
|
@logger = SimpleLogger.new.logger if @logger.nil?
|
|
61
95
|
end
|
|
96
|
+
|
|
97
|
+
private
|
|
98
|
+
|
|
99
|
+
def validate_environment_settings
|
|
100
|
+
if !subdomain.nil? && @use_legacy_domain
|
|
101
|
+
raise CheckoutArgumentException,
|
|
102
|
+
'with_environment_subdomain and with_legacy_domain cannot both be set - provide ' \
|
|
103
|
+
'only your merchant-specific subdomain'
|
|
104
|
+
end
|
|
105
|
+
return unless subdomain.nil? && !@use_legacy_domain && requires_environment_subdomain?
|
|
106
|
+
|
|
107
|
+
raise CheckoutArgumentException,
|
|
108
|
+
'environment subdomain is required - provide your merchant-specific subdomain ' \
|
|
109
|
+
'(typically your client ID excluding the cli_ prefix, see ' \
|
|
110
|
+
'https://api-reference.checkout.com/#section/Base-URLs), or call with_legacy_domain ' \
|
|
111
|
+
'to opt out only if merchant specific sub domains are causing issues'
|
|
112
|
+
end
|
|
62
113
|
end
|
|
63
114
|
end
|
|
@@ -22,6 +22,7 @@ require 'checkout_sdk/accounts/profile'
|
|
|
22
22
|
require 'checkout_sdk/accounts/accounts_client'
|
|
23
23
|
require 'checkout_sdk/accounts/entity_financial_documents'
|
|
24
24
|
require 'checkout_sdk/accounts/document_type'
|
|
25
|
+
require 'checkout_sdk/accounts/instrument_document_type'
|
|
25
26
|
require 'checkout_sdk/accounts/company'
|
|
26
27
|
require 'checkout_sdk/accounts/phone'
|
|
27
28
|
require 'checkout_sdk/accounts/contact_details'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Accounts
|
|
5
|
+
# The document type accepted by the legal document that verifies a bank account when
|
|
6
|
+
# creating a payment instrument.
|
|
7
|
+
#
|
|
8
|
+
# Deliberately separate from DocumentType, which lists identity documents (passport,
|
|
9
|
+
# national identity card, driving license). The API keeps the bank account document type
|
|
10
|
+
# as its own enum whose only accepted value is bank_statement, so offering it alongside
|
|
11
|
+
# the identity documents would suggest it is valid where the API rejects it, and vice
|
|
12
|
+
# versa.
|
|
13
|
+
module InstrumentDocumentType
|
|
14
|
+
BANK_STATEMENT = 'bank_statement'
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Accounts
|
|
5
|
+
# For SaaS sellers (ISV), a daily schedule runs on working days only (Monday to Friday);
|
|
6
|
+
# payouts do not take place on weekends.
|
|
5
7
|
class ScheduleFrequencyDaily < ScheduleRequest
|
|
6
8
|
def initialize
|
|
7
9
|
super(ScheduleFrequencyType::DAILY)
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Accounts
|
|
5
5
|
# @!attribute by_month_day
|
|
6
|
-
# @return [Array(Integer)]
|
|
6
|
+
# @return [Array(Integer)] The day or days of the month the payout should take place.
|
|
7
|
+
# For SaaS sellers (ISV), only the following combinations are supported, in any order:
|
|
8
|
+
# [1], [15], [1, 15] or [1, 16].
|
|
7
9
|
class ScheduleFrequencyMonthly < ScheduleRequest
|
|
8
10
|
attr_accessor :by_month_day
|
|
9
11
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Accounts
|
|
5
5
|
# @!attribute by_day
|
|
6
|
-
# @return [Array(String)]
|
|
6
|
+
# @return [Array(String)] The day or days of the week the payout should take place.
|
|
7
|
+
# For SaaS sellers (ISV), only working days (Monday to Friday) are supported;
|
|
8
|
+
# payouts set to take place on weekends are rejected.
|
|
7
9
|
class ScheduleFrequencyWeekly < ScheduleRequest
|
|
8
10
|
attr_accessor :by_day
|
|
9
11
|
|
|
@@ -6,11 +6,22 @@ module CheckoutSdk
|
|
|
6
6
|
# @return [TrueClass, FalseClass]
|
|
7
7
|
# @!attribute threshold
|
|
8
8
|
# @return [TrueClass, FalseClass]
|
|
9
|
+
# @!attribute balance_minimum
|
|
10
|
+
# @return [Integer] The amount, in the minor units of the schedule's currency, to retain in the
|
|
11
|
+
# sub-entity's available balance. SaaS sellers (ISV) only. Defaults to 0 if you do not set it.
|
|
12
|
+
# @!attribute carry_forward_enabled
|
|
13
|
+
# @return [TrueClass, FalseClass] Indicates whether to carry forward any balance below the configured
|
|
14
|
+
# minimum to the next payout. SaaS sellers (ISV) only. Defaults to false if you do not set it.
|
|
15
|
+
# @!attribute payment_instrument_id
|
|
16
|
+
# @return [String] The ID of the platforms payment instrument used as the payout destination.
|
|
9
17
|
# @!attribute recurrence
|
|
10
18
|
# @return [ScheduleRequest]
|
|
11
19
|
class UpdateSchedule
|
|
12
20
|
attr_accessor :enabled,
|
|
13
21
|
:threshold,
|
|
22
|
+
:balance_minimum,
|
|
23
|
+
:carry_forward_enabled,
|
|
24
|
+
:payment_instrument_id,
|
|
14
25
|
:recurrence
|
|
15
26
|
end
|
|
16
27
|
end
|
|
@@ -42,15 +42,8 @@ module CheckoutSdk
|
|
|
42
42
|
def build
|
|
43
43
|
super
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
auth_uri =
|
|
47
|
-
if auth_uri.nil? || auth_uri.empty?
|
|
48
|
-
auth_uri = if environment_subdomain
|
|
49
|
-
environment_subdomain.authorization_uri
|
|
50
|
-
else
|
|
51
|
-
environment.authorization_uri
|
|
52
|
-
end
|
|
53
|
-
end
|
|
45
|
+
env_subdomain = environment_subdomain
|
|
46
|
+
auth_uri = resolve_authorization_uri(env_subdomain)
|
|
54
47
|
|
|
55
48
|
configuration = CheckoutConfiguration.new(
|
|
56
49
|
OAuthSdkCredentials.new(client_id,
|
|
@@ -66,9 +59,29 @@ module CheckoutSdk
|
|
|
66
59
|
logger
|
|
67
60
|
)
|
|
68
61
|
|
|
69
|
-
configuration.environment_subdomain =
|
|
62
|
+
configuration.environment_subdomain = env_subdomain if env_subdomain
|
|
70
63
|
|
|
71
64
|
CheckoutApi.new(configuration)
|
|
72
65
|
end
|
|
66
|
+
|
|
67
|
+
private
|
|
68
|
+
|
|
69
|
+
# @param [EnvironmentSubdomain, nil] env_subdomain
|
|
70
|
+
# @return [String]
|
|
71
|
+
def resolve_authorization_uri(env_subdomain)
|
|
72
|
+
auth_uri = authorization_uri
|
|
73
|
+
explicit_uri_set = !(auth_uri.nil? || auth_uri.empty?)
|
|
74
|
+
|
|
75
|
+
if explicit_uri_set && env_subdomain
|
|
76
|
+
raise CheckoutArgumentException,
|
|
77
|
+
'authorization_uri and environment_subdomain cannot both be set - the token ' \
|
|
78
|
+
'endpoint is derived from your subdomain; combine authorization_uri with ' \
|
|
79
|
+
'with_legacy_domain if you need a custom token host'
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
return auth_uri if explicit_uri_set
|
|
83
|
+
|
|
84
|
+
env_subdomain ? env_subdomain.authorization_uri : environment.authorization_uri
|
|
85
|
+
end
|
|
73
86
|
end
|
|
74
87
|
end
|
|
@@ -19,7 +19,8 @@ module CheckoutSdk
|
|
|
19
19
|
logger
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
env_subdomain = environment_subdomain
|
|
23
|
+
configuration.environment_subdomain = env_subdomain if env_subdomain
|
|
23
24
|
|
|
24
25
|
CheckoutApi.new(configuration)
|
|
25
26
|
end
|
|
@@ -23,36 +23,35 @@ module CheckoutSdk
|
|
|
23
23
|
|
|
24
24
|
private
|
|
25
25
|
|
|
26
|
-
# Applies subdomain transformation to any given URI.
|
|
27
|
-
# If the subdomain is valid (alphanumeric pattern), prepends it to the host.
|
|
28
|
-
# Otherwise, returns the original URI unchanged.
|
|
26
|
+
# Applies subdomain transformation to any given URI, prepending the subdomain to the host.
|
|
29
27
|
#
|
|
30
28
|
# @param original_url [String] The original URL to transform.
|
|
31
29
|
# @param subdomain [String] The subdomain to prepend to the host.
|
|
32
|
-
# @return [String] The transformed URL with subdomain
|
|
30
|
+
# @return [String] The transformed URL with subdomain.
|
|
31
|
+
# @raise [CheckoutArgumentException] If the subdomain is not a valid merchant-specific
|
|
32
|
+
# subdomain.
|
|
33
33
|
def create_url_with_subdomain(original_url, subdomain)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
port = url_parts.scheme == 'https' && url_parts.port == 443 ? nil : url_parts.port
|
|
34
|
+
unless subdomain =~ /\A(?:pl-)?[a-z0-9]+\z/
|
|
35
|
+
raise CheckoutArgumentException,
|
|
36
|
+
'invalid environment subdomain - provide your merchant-specific subdomain, ' \
|
|
37
|
+
'typically your client ID excluding the cli_ prefix (see ' \
|
|
38
|
+
'https://api-reference.checkout.com/#section/Base-URLs)'
|
|
39
|
+
end
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
userinfo: url_parts.userinfo,
|
|
45
|
-
host: new_host,
|
|
46
|
-
port: port,
|
|
47
|
-
path: url_parts.path,
|
|
48
|
-
query: url_parts.query,
|
|
49
|
-
fragment: url_parts.fragment
|
|
50
|
-
)
|
|
41
|
+
url_parts = URI.parse(original_url)
|
|
42
|
+
new_host = "#{subdomain}.#{url_parts.host}"
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
end
|
|
44
|
+
port = url_parts.scheme == 'https' && url_parts.port == 443 ? nil : url_parts.port
|
|
54
45
|
|
|
55
|
-
|
|
46
|
+
URI::Generic.build(
|
|
47
|
+
scheme: url_parts.scheme,
|
|
48
|
+
userinfo: url_parts.userinfo,
|
|
49
|
+
host: new_host,
|
|
50
|
+
port: port,
|
|
51
|
+
path: url_parts.path,
|
|
52
|
+
query: url_parts.query,
|
|
53
|
+
fragment: url_parts.fragment
|
|
54
|
+
).to_s
|
|
56
55
|
end
|
|
57
56
|
end
|
|
58
57
|
end
|
|
@@ -5,12 +5,94 @@ module CheckoutSdk
|
|
|
5
5
|
# Response-side `processing` object returned alongside payment responses.
|
|
6
6
|
# Distinct from {ProcessingSettings} which is the request-side equivalent.
|
|
7
7
|
#
|
|
8
|
-
# Mirrors the swagger ProcessingData schema
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# scheme
|
|
13
|
-
#
|
|
8
|
+
# Mirrors the swagger ProcessingData schema, referenced by PaymentDetails.processing
|
|
9
|
+
# (GET /payments/{id}).
|
|
10
|
+
#
|
|
11
|
+
# @!attribute preferred_scheme
|
|
12
|
+
# @return [String] [Optional] The preferred scheme for co-badged card payment processing.
|
|
13
|
+
# If performing 3DS via a third party, this is the scheme that processed 3DS. Does not
|
|
14
|
+
# support PINless debit schemes in the US (STAR, PULSE, NYCE, ACCEL, SHAZAM).
|
|
15
|
+
# Enum: "mastercard" "visa" "cartes_bancaires"
|
|
16
|
+
# @!attribute app_id
|
|
17
|
+
# @return [String] [Optional] The customer's application identifier.
|
|
18
|
+
# @!attribute partner_customer_id
|
|
19
|
+
# @return [String] [Optional] The customer's ID on the partner platform.
|
|
20
|
+
# @!attribute partner_payment_id
|
|
21
|
+
# @return [String] [Optional] The partner-originated unique payment identifier.
|
|
22
|
+
# @!attribute tax_amount
|
|
23
|
+
# @return [Numeric] [Optional] Total tax amount of the order.
|
|
24
|
+
# @!attribute locale
|
|
25
|
+
# @return [String] [Optional] The language and region of the customer. ISO 639-2 language
|
|
26
|
+
# code, its value consists of language-country. Pattern:
|
|
27
|
+
# ^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}))?$ - min 2 characters, max 10 characters
|
|
28
|
+
# @!attribute retrieval_reference_number
|
|
29
|
+
# @return [String] [Optional] A unique identifier for the authorization provided by partner.
|
|
30
|
+
# @!attribute partner_order_id
|
|
31
|
+
# @return [String] [Optional] The Klarna order ID associated with the payment.
|
|
32
|
+
# @!attribute partner_status
|
|
33
|
+
# @return [String] [Optional] Status of a payment provided by partner.
|
|
34
|
+
# @!attribute partner_transaction_id
|
|
35
|
+
# @return [String] [Optional] Unique transaction identification provided by partner.
|
|
36
|
+
# @!attribute partner_error_codes
|
|
37
|
+
# @return [Array<String>] [Optional] The list of error codes that led the payment to fail or
|
|
38
|
+
# be declined, as given by the payment provider.
|
|
39
|
+
# @!attribute partner_error_message
|
|
40
|
+
# @return [String] [Optional] Error description provided by partner.
|
|
41
|
+
# @!attribute partner_authorization_code
|
|
42
|
+
# @return [String] [Optional] Authorization code provided by partner.
|
|
43
|
+
# @!attribute partner_authorization_response_code
|
|
44
|
+
# @return [String] [Optional] Authorization response code provided by partner.
|
|
45
|
+
# @!attribute partner_fraud_status
|
|
46
|
+
# @return [String] [Optional] Partner fraud status. If the status is Pending, and the
|
|
47
|
+
# merchant captures before it changes to Accepted, the risk of the transaction is solely
|
|
48
|
+
# on the merchant.
|
|
49
|
+
# @!attribute partner_merchant_advice_code
|
|
50
|
+
# @return [String] [Optional] The Mastercard Merchant Advice Code (MAC), which contains
|
|
51
|
+
# additional information about the transaction. For declined transactions it also
|
|
52
|
+
# indicates whether the payment can be retried and how long to wait.
|
|
53
|
+
# @!attribute custom_payment_method_ids
|
|
54
|
+
# @return [Array<String>] [Optional] An array defining which of the configured payment
|
|
55
|
+
# options within a payment category (for example, pay_later or pay_over_time) should be
|
|
56
|
+
# displayed for this purchase.
|
|
57
|
+
# @!attribute aft
|
|
58
|
+
# @return [Boolean] [Optional] Indicates whether the payment is an Account Funding
|
|
59
|
+
# Transaction.
|
|
60
|
+
# @!attribute merchant_category_code
|
|
61
|
+
# @return [String] [Optional] Four-digit code for retail financial services expressed in
|
|
62
|
+
# ISO 18245 format, classifying the types of goods or services you provide.
|
|
63
|
+
# @!attribute scheme_merchant_id
|
|
64
|
+
# @return [String] [Optional] The merchant identifier that was configured with the scheme
|
|
65
|
+
# and used for the payment.
|
|
66
|
+
# @!attribute pan_type_processed
|
|
67
|
+
# @return [String] [Optional] The type of Primary Account Number (PAN) used for the payment.
|
|
68
|
+
# DPAN indicates a network token was used, FPAN indicates the full card was used.
|
|
69
|
+
# Enum: "fpan" "dpan"
|
|
70
|
+
# @!attribute fallback_source_used
|
|
71
|
+
# @return [Boolean] [Optional] Indicates whether the fallback_source field was used for
|
|
72
|
+
# the payment.
|
|
73
|
+
# @!attribute failure_code
|
|
74
|
+
# @return [String] [Optional] A high-level failure category returned by the payment provider
|
|
75
|
+
# when a payment is declined or fails. Not all payment methods return this field.
|
|
76
|
+
# @!attribute partner_code
|
|
77
|
+
# @return [String] [Optional] The 6-digit partner code returned by the payment provider.
|
|
78
|
+
# Returned when source.type is blik. Pattern: ^\d{6}$ - 6 characters
|
|
79
|
+
# @!attribute partner_response_code
|
|
80
|
+
# @return [String] [Optional] The raw response code returned by the payment provider when a
|
|
81
|
+
# payment is declined or fails. Not all payment methods return this field.
|
|
82
|
+
# @!attribute scheme
|
|
83
|
+
# @return [String] [Optional] The scheme on which the payment was authorized. This may
|
|
84
|
+
# differ from the card's scheme used for the payment if the card is co-badged and the
|
|
85
|
+
# payment was authorized on a different network. Read-only.
|
|
86
|
+
# @!attribute accommodation_data
|
|
87
|
+
# @return [Array<AccommodationData>] [Optional] Contains information about the accommodation
|
|
88
|
+
# booked by the customer.
|
|
89
|
+
# @!attribute airline_data
|
|
90
|
+
# @return [Array<AirlineData>] [Optional] Contains information about the airline ticket and
|
|
91
|
+
# flights booked by the customer.
|
|
92
|
+
# @!attribute scheme_transaction_link_id
|
|
93
|
+
# @return [String] [Optional] The scheme transaction link identifier. Returned for
|
|
94
|
+
# Mastercard transactions when the scheme provides a link identifier that ties together
|
|
95
|
+
# related transactions on the network.
|
|
14
96
|
class ProcessingData
|
|
15
97
|
attr_accessor :preferred_scheme,
|
|
16
98
|
:app_id,
|
|
@@ -39,7 +121,8 @@ module CheckoutSdk
|
|
|
39
121
|
:partner_response_code,
|
|
40
122
|
:scheme,
|
|
41
123
|
:accommodation_data,
|
|
42
|
-
:airline_data
|
|
124
|
+
:airline_data,
|
|
125
|
+
:scheme_transaction_link_id
|
|
43
126
|
end
|
|
44
127
|
end
|
|
45
128
|
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 :
|
|
13
|
+
attr_accessor :amount,
|
|
14
|
+
:reference,
|
|
11
15
|
:metadata
|
|
12
16
|
end
|
|
13
17
|
end
|
|
@@ -7,6 +7,12 @@ module CheckoutSdk
|
|
|
7
7
|
PUBLIC_KEY_PATTERN = '^pk_(test_)?(\\w{8})-(\\w{4})-(\\w{4})-(\\w{4})-(\\w{12})$'
|
|
8
8
|
private_constant :SECRET_KEY_PATTERN, :PUBLIC_KEY_PATTERN
|
|
9
9
|
|
|
10
|
+
# The Previous (ABC) platform predates merchant-specific subdomains, so it is exempt from
|
|
11
|
+
# the mandatory with_environment_subdomain/with_legacy_domain configuration.
|
|
12
|
+
def requires_environment_subdomain?
|
|
13
|
+
false
|
|
14
|
+
end
|
|
15
|
+
|
|
10
16
|
def build
|
|
11
17
|
@secret_key_pattern = SECRET_KEY_PATTERN
|
|
12
18
|
@public_key_pattern = PUBLIC_KEY_PATTERN
|
|
@@ -19,7 +25,8 @@ module CheckoutSdk
|
|
|
19
25
|
logger
|
|
20
26
|
)
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
env_subdomain = environment_subdomain
|
|
29
|
+
configuration.environment_subdomain = env_subdomain if env_subdomain
|
|
23
30
|
|
|
24
31
|
CheckoutApi.new(configuration)
|
|
25
32
|
end
|
data/lib/checkout_sdk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: checkout_sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Checkout
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -188,6 +188,7 @@ files:
|
|
|
188
188
|
- lib/checkout_sdk/accounts/instrument_details_faster_payments.rb
|
|
189
189
|
- lib/checkout_sdk/accounts/instrument_details_sepa.rb
|
|
190
190
|
- lib/checkout_sdk/accounts/instrument_document.rb
|
|
191
|
+
- lib/checkout_sdk/accounts/instrument_document_type.rb
|
|
191
192
|
- lib/checkout_sdk/accounts/invitee.rb
|
|
192
193
|
- lib/checkout_sdk/accounts/national_id_type.rb
|
|
193
194
|
- lib/checkout_sdk/accounts/onboard_entity.rb
|