checkout_sdk 1.3.0 → 1.4.1
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/checkout_api.rb +5 -1
- data/lib/checkout_sdk/forward/forward.rb +3 -0
- data/lib/checkout_sdk/forward/forward_client.rb +26 -0
- data/lib/checkout_sdk/oauth_access_token.rb +6 -1
- data/lib/checkout_sdk/oauth_scopes.rb +1 -0
- data/lib/checkout_sdk/oauth_sdk_credentials.rb +2 -1
- data/lib/checkout_sdk/payments/processing_settings.rb +7 -1
- data/lib/checkout_sdk/payments/product.rb +7 -1
- data/lib/checkout_sdk/payments/product_sub_type.rb +13 -0
- data/lib/checkout_sdk/payments/sessions/store_payment_details_type.rb +1 -0
- data/lib/checkout_sdk/transfers/create_transfer.rb +5 -5
- data/lib/checkout_sdk/transfers/transfer_source.rb +4 -1
- data/lib/checkout_sdk/transfers/transfers_client.rb +2 -2
- data/lib/checkout_sdk/version.rb +1 -1
- data/lib/checkout_sdk.rb +1 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1972baffa08559a77eba645b790a981552144c4b5af7450936161b677e080c8
|
|
4
|
+
data.tar.gz: dfa0d1690acc596cb7108304c7704bb606fa1bd082bb99ab6ec4f8c381615de8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d93aa8c8e91d1e51935ce338ccfecc87bb663ee9f806edc28a77d239340653b20c68389d2c9f8752f37d02f540bcac5f418bbef11538559a22d12d7d7b78227
|
|
7
|
+
data.tar.gz: 68295d7212f13138cb404df36bd8aca3b78ed0db7950d12d87a7590da8f04b8426e12c49deae821296a8826918a2da906d4962328ccf78169480c3d8973b2f68
|
|
@@ -43,6 +43,8 @@ module CheckoutSdk
|
|
|
43
43
|
# @return [CheckoutSdk::Payments::PaymentContextsClient]
|
|
44
44
|
# @!attribute payment_sessions
|
|
45
45
|
# @return [CheckoutSdk::Payments::PaymentSessionsClient]
|
|
46
|
+
# @!attribute forward
|
|
47
|
+
# @return [CheckoutSdk::Forward::ForwardClient]
|
|
46
48
|
class CheckoutApi
|
|
47
49
|
attr_reader :customers,
|
|
48
50
|
:disputes,
|
|
@@ -64,7 +66,8 @@ module CheckoutSdk
|
|
|
64
66
|
:financial,
|
|
65
67
|
:issuing,
|
|
66
68
|
:contexts,
|
|
67
|
-
:payment_sessions
|
|
69
|
+
:payment_sessions,
|
|
70
|
+
:forward
|
|
68
71
|
|
|
69
72
|
# @param [CheckoutConfiguration] configuration
|
|
70
73
|
def initialize(configuration)
|
|
@@ -90,6 +93,7 @@ module CheckoutSdk
|
|
|
90
93
|
@issuing = CheckoutSdk::Issuing::IssuingClient.new api_client, configuration
|
|
91
94
|
@contexts = CheckoutSdk::Payments::PaymentContextsClient.new api_client, configuration
|
|
92
95
|
@payment_sessions = CheckoutSdk::Payments::PaymentSessionsClient.new api_client, configuration
|
|
96
|
+
@forward = CheckoutSdk::Forward::ForwardClient.new(api_client, configuration)
|
|
93
97
|
end
|
|
94
98
|
|
|
95
99
|
private
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CheckoutSdk
|
|
4
|
+
module Forward
|
|
5
|
+
class ForwardClient < Client
|
|
6
|
+
FORWARD = 'forward'
|
|
7
|
+
private_constant :FORWARD
|
|
8
|
+
|
|
9
|
+
# @param [ApiClient] api_client
|
|
10
|
+
# @param [CheckoutConfiguration] configuration
|
|
11
|
+
def initialize(api_client, configuration)
|
|
12
|
+
super(api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @param [Hash] forward_request
|
|
16
|
+
def forward_request(forward_request)
|
|
17
|
+
api_client.invoke_post(build_path(FORWARD), sdk_authorization, forward_request)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @param [String] forward_id
|
|
21
|
+
def get(forward_id)
|
|
22
|
+
api_client.invoke_get(build_path(FORWARD, forward_id), sdk_authorization)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
# @!attribute token
|
|
5
5
|
# @return [String]
|
|
6
|
+
# @!attribute token_type
|
|
7
|
+
# @return [String]
|
|
6
8
|
# @!attribute expiration_date
|
|
7
9
|
# @return [Time]
|
|
8
10
|
class OAuthAccessToken
|
|
9
11
|
attr_accessor :token,
|
|
12
|
+
:token_type,
|
|
10
13
|
:expiration_date
|
|
11
14
|
|
|
12
15
|
# @param [String] token
|
|
16
|
+
# @param [String] token_type
|
|
13
17
|
# @param [Time] expiration_date
|
|
14
18
|
# @return [OAuthAccessToken]
|
|
15
|
-
def initialize(token, expiration_date)
|
|
19
|
+
def initialize(token, token_type, expiration_date)
|
|
16
20
|
@token = token
|
|
21
|
+
@token_type = token_type
|
|
17
22
|
@expiration_date = expiration_date
|
|
18
23
|
end
|
|
19
24
|
|
|
@@ -59,9 +59,9 @@ module CheckoutSdk
|
|
|
59
59
|
return @access_token unless @access_token.nil? || @access_token.token.nil? || !@access_token.valid?
|
|
60
60
|
|
|
61
61
|
data = {
|
|
62
|
+
grant_type: 'client_credentials',
|
|
62
63
|
client_id: @client_id,
|
|
63
64
|
client_secret: @client_secret,
|
|
64
|
-
grant_type: 'client_credentials',
|
|
65
65
|
scope: @scopes.join(' ')
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -81,6 +81,7 @@ module CheckoutSdk
|
|
|
81
81
|
oauth_response = JSON.parse(response.body, object_class: OpenStruct)
|
|
82
82
|
|
|
83
83
|
@access_token = OAuthAccessToken.new(oauth_response.access_token,
|
|
84
|
+
oauth_response.token_type,
|
|
84
85
|
Time.now + oauth_response.expires_in)
|
|
85
86
|
end
|
|
86
87
|
|
|
@@ -68,6 +68,10 @@ module CheckoutSdk
|
|
|
68
68
|
# @return [SenderInformation]
|
|
69
69
|
# @!attribute purpose
|
|
70
70
|
# @return [String]
|
|
71
|
+
# @!attribute affiliate_id
|
|
72
|
+
# @return [string]
|
|
73
|
+
# @!attribute affiliate_url
|
|
74
|
+
# @return [string]
|
|
71
75
|
class ProcessingSettings
|
|
72
76
|
attr_accessor :order_id,
|
|
73
77
|
:tax_amount,
|
|
@@ -101,7 +105,9 @@ module CheckoutSdk
|
|
|
101
105
|
:shipping_info,
|
|
102
106
|
:dlocal,
|
|
103
107
|
:senderInformation,
|
|
104
|
-
:purpose
|
|
108
|
+
:purpose,
|
|
109
|
+
:affiliate_id,
|
|
110
|
+
:affiliate_url
|
|
105
111
|
end
|
|
106
112
|
end
|
|
107
113
|
end
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Payments
|
|
5
|
+
# @!attribute type
|
|
6
|
+
# @return [String]
|
|
7
|
+
# @!attribute sub_type
|
|
8
|
+
# @return [String] {ProductSubType}
|
|
5
9
|
# @!attribute name
|
|
6
10
|
# @return [String]
|
|
7
11
|
# @!attribute quantity
|
|
@@ -31,7 +35,9 @@ module CheckoutSdk
|
|
|
31
35
|
# @!attribute sku
|
|
32
36
|
# @return [String]
|
|
33
37
|
class Product
|
|
34
|
-
attr_accessor :
|
|
38
|
+
attr_accessor :type,
|
|
39
|
+
:sub_type,
|
|
40
|
+
:name,
|
|
35
41
|
:quantity,
|
|
36
42
|
:unit_price,
|
|
37
43
|
:reference,
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module CheckoutSdk
|
|
4
4
|
module Transfers
|
|
5
|
-
# @!attribute reference
|
|
6
|
-
# @return [String]
|
|
7
5
|
# @!attribute transfer_type
|
|
8
6
|
# @return [String] {TransferType}
|
|
9
7
|
# @!attribute source
|
|
10
8
|
# @return [TransferSource]
|
|
11
9
|
# @!attribute destination
|
|
12
10
|
# @return [TransferDestination]
|
|
11
|
+
# @!attribute reference
|
|
12
|
+
# @return [String]
|
|
13
13
|
class CreateTransfer
|
|
14
|
-
attr_accessor :
|
|
15
|
-
:transfer_type,
|
|
14
|
+
attr_accessor :transfer_type,
|
|
16
15
|
:source,
|
|
17
|
-
:destination
|
|
16
|
+
:destination,
|
|
17
|
+
:reference
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -6,9 +6,12 @@ module CheckoutSdk
|
|
|
6
6
|
# @return [String]
|
|
7
7
|
# @!attribute amount
|
|
8
8
|
# @return [Integer]
|
|
9
|
+
# @!attribute currency
|
|
10
|
+
# @return [CheckoutSdk::Common::Currency]
|
|
9
11
|
class TransferSource
|
|
10
12
|
attr_accessor :id,
|
|
11
|
-
:amount
|
|
13
|
+
:amount,
|
|
14
|
+
:currency
|
|
12
15
|
end
|
|
13
16
|
end
|
|
14
17
|
end
|
|
@@ -13,8 +13,8 @@ module CheckoutSdk
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# @param [Hash, CreateTransfer] create_transfer
|
|
16
|
-
# @param [String
|
|
17
|
-
def initiate_transfer_of_funds(create_transfer, idempotency_key
|
|
16
|
+
# @param [String] idempotency_key
|
|
17
|
+
def initiate_transfer_of_funds(create_transfer, idempotency_key)
|
|
18
18
|
api_client.invoke_post(TRANSFERS, sdk_authorization, create_transfer, idempotency_key)
|
|
19
19
|
end
|
|
20
20
|
|
data/lib/checkout_sdk/version.rb
CHANGED
data/lib/checkout_sdk.rb
CHANGED
|
@@ -67,6 +67,7 @@ require 'checkout_sdk/transfers/transfers'
|
|
|
67
67
|
require 'checkout_sdk/metadata/metadata'
|
|
68
68
|
require 'checkout_sdk/financial/financial'
|
|
69
69
|
require 'checkout_sdk/issuing/issuing'
|
|
70
|
+
require 'checkout_sdk/forward/forward'
|
|
70
71
|
|
|
71
72
|
# Checkout modules (previous)
|
|
72
73
|
require 'checkout_sdk/sources/sources'
|
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: 1.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Checkout
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-04
|
|
11
|
+
date: 2025-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -257,6 +257,8 @@ files:
|
|
|
257
257
|
- lib/checkout_sdk/forex/forex_source.rb
|
|
258
258
|
- lib/checkout_sdk/forex/quote_request.rb
|
|
259
259
|
- lib/checkout_sdk/forex/rates_query_filter.rb
|
|
260
|
+
- lib/checkout_sdk/forward/forward.rb
|
|
261
|
+
- lib/checkout_sdk/forward/forward_client.rb
|
|
260
262
|
- lib/checkout_sdk/http_metadata.rb
|
|
261
263
|
- lib/checkout_sdk/instruments/base_instruments_client.rb
|
|
262
264
|
- lib/checkout_sdk/instruments/create/instrument.rb
|
|
@@ -384,6 +386,7 @@ files:
|
|
|
384
386
|
- lib/checkout_sdk/payments/previous/source/token_source.rb
|
|
385
387
|
- lib/checkout_sdk/payments/processing_settings.rb
|
|
386
388
|
- lib/checkout_sdk/payments/product.rb
|
|
389
|
+
- lib/checkout_sdk/payments/product_sub_type.rb
|
|
387
390
|
- lib/checkout_sdk/payments/product_type.rb
|
|
388
391
|
- lib/checkout_sdk/payments/refund_order.rb
|
|
389
392
|
- lib/checkout_sdk/payments/refund_request.rb
|