checkout_sdk 1.3.0 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26a49fd0dc6d8074742539d0651bdb5c94d255bdaa5ee5be1944c8d7ec2b0c6f
4
- data.tar.gz: 914ac0e1f225f44336272904d87224442055d6d7f869e99c183301ebc07544c6
3
+ metadata.gz: 7eaf0e31423e11480363f98307c62e05526fd5b08278054afe51c519f0be6693
4
+ data.tar.gz: db532611e11ae196393c372eb2e578ddd633ceec2136403c46ea2d15632694d3
5
5
  SHA512:
6
- metadata.gz: e32feee8e37ce63ce23dbc396151f12c469d8361da8dad4a3272801ea272d648a3e46b5ff889662d088d4874316159ce30cbaa671f7b4c94d22f3d7352e66341
7
- data.tar.gz: d4af9e3225ea291ac6570d4d6bcce2892c1816a9163f154d7659b09d03c8a1d68a4fe9f08f937ecb24d74d22268b82bd9706ba92a636ef57e9f1ab1495a1f4b7
6
+ metadata.gz: 25e1a330e214cedd7de9137033d99b4c22cd9f3e306431c8bbe4ebf7ea7f098aa8734e813d9b31ad287151f259c3d20a78cc79d825aa9359c69a6f3e119e6022
7
+ data.tar.gz: 37f0915dd19a1b337ea03aaae0732ba884455e42ccb86d2188d7e3e9cc0e449ebca9be9c4c70ba67f34f3411be9a68006f4ec34365fc4a6cabb7caf5b41c2012
@@ -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,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/forward/forward_client'
@@ -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
 
@@ -47,5 +47,6 @@ module CheckoutSdk
47
47
  ISSUING_CARD_MGMT = 'issuing:card-mgmt'
48
48
  ISSUING_CONTROLS_READ = 'issuing:controls-read'
49
49
  ISSUING_CONTROLS_WRITE = 'issuing:controls-write'
50
+ FORWARD = 'forward'
50
51
  end
51
52
  end
@@ -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
 
@@ -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 :reference,
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, nil] idempotency_key
17
- def initiate_transfer_of_funds(create_transfer, idempotency_key = nil)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
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.3.0
4
+ version: 1.4.0
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-16 00:00:00.000000000 Z
11
+ date: 2025-06-23 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