adyen-ruby-api-library 10.2.0 → 10.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: 137ddf1d5466bdff9b44038d6e74ccc8fca34e8ca3f0230d3112f9994cf23239
4
- data.tar.gz: 1f8778735ff8fbb89931351f320792c7b6e648b6de646ae396b99dd10f66be53
3
+ metadata.gz: 2c646e26363f5d6c02a69b973a8afad037355e531c284d55589d540f621b84ca
4
+ data.tar.gz: 619550bc5183dcb47050f01d774590b9b50b431fcc32fbdaed09a786e8f13a77
5
5
  SHA512:
6
- metadata.gz: 4aaf4afc6b1c9285a99f368ee338543cfa27e94de751bc54c4f2fee32e359cb3bc0c0753da28f54d5bf9704396a062c196912d1e944afc445eece0472e00af85
7
- data.tar.gz: 9ccf08ccfad1b8f8b49da70fe8d30e1f4f382e578c7a513ae9e925abb8abc776ede04d2d1868275a2c96b1b6d28a3fb8177d7b74130f23b464a22b3ed425a3bd
6
+ metadata.gz: d2f4544d2cf7b59ec1deceae8c43168e0cda341c3cd7153533579ac3df3bb4663771d4ea24e8feb70f9429c993c7ee7eefc34f4ef867ab968034b2831a5eaa00
7
+ data.tar.gz: c8ad57af40a03bf3728ddb987f55afe2d5373f94b7106e7cc6db2dcce6cef78e58b1850ac3325e20b6fa79b0cd927e1898d203a4c20ea8db57d5892d4d60789b
@@ -18,6 +18,7 @@ jobs:
18
18
  days-before-issue-stale: 14
19
19
  days-before-issue-close: 7
20
20
  stale-issue-label: 'stale'
21
+ close-issue-label: 'closed-due-to-inactivity'
21
22
  exempt-issue-labels: 'do not stale, needs response'
22
23
  days-before-pr-stale: 365
23
24
  days-before-pr-close: 30
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  ruby '>= 2.7.0'
6
6
 
7
- gem 'faraday'
7
+ gem 'faraday', '2.8.1'
8
8
 
9
9
  gem 'activesupport', group: :development
10
10
  gem 'bundler', group: :development
data/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 10.2.0
1
+ 10.4.0
2
2
 
data/lib/adyen/client.rb CHANGED
@@ -32,7 +32,18 @@ module Adyen
32
32
  end
33
33
  @mock_service_url_base = mock_service_url_base || "http://localhost:#{mock_port}"
34
34
  @live_url_prefix = live_url_prefix
35
- @connection_options = connection_options || Faraday::ConnectionOptions.new
35
+ if RUBY_VERSION >= '3.2'
36
+ # set default timeouts
37
+ @connection_options = connection_options || Faraday::ConnectionOptions.new(
38
+ request: Faraday::RequestOptions.new(
39
+ open_timeout: 30,
40
+ timeout: 60
41
+ )
42
+ )
43
+ else
44
+ @connection_options = connection_options || Faraday::ConnectionOptions.new
45
+ end
46
+
36
47
  @terminal_region = terminal_region
37
48
  end
38
49
 
@@ -53,6 +64,8 @@ module Adyen
53
64
 
54
65
  # base URL for API given service and @env
55
66
  def service_url_base(service)
67
+ # maps 'Disputes' to expected service name 'DisputesService' for URL matching
68
+ service = 'DisputesService' if service == 'Disputes'
56
69
  if @env == :mock
57
70
  @mock_service_url_base
58
71
  else
@@ -0,0 +1,56 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class AuthorizedCardUsersApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'BalancePlatform')
13
+ end
14
+
15
+ # Create authorized users for a card.
16
+ def create_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
17
+ endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint, payment_instrument_id)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Delete the authorized users for a card.
26
+ def delete_authorised_card_users(payment_instrument_id, headers: {})
27
+ endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint, payment_instrument_id)
30
+
31
+ action = { method: 'delete', url: endpoint }
32
+ @client.call_adyen_api(@service, action, {}, headers, @version)
33
+ end
34
+
35
+ # Get authorized users for a card.
36
+ def get_all_authorised_card_users(payment_instrument_id, headers: {})
37
+ endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint, payment_instrument_id)
40
+
41
+ action = { method: 'get', url: endpoint }
42
+ @client.call_adyen_api(@service, action, {}, headers, @version)
43
+ end
44
+
45
+ # Update the authorized users for a card.
46
+ def update_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
47
+ endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, payment_instrument_id)
50
+
51
+ action = { method: 'patch', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ end
56
+ end
@@ -0,0 +1,66 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class BalancesApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'BalancePlatform')
13
+ end
14
+
15
+ # Create a balance webhook setting
16
+ def create_webhook_setting(request, balance_platform_id, webhook_id, balance_webhook_setting_info, headers: {})
17
+ endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint, balance_platform_id, webhook_id)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Delete a balance webhook setting by id
26
+ def delete_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
27
+ endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
30
+
31
+ action = { method: 'delete', url: endpoint }
32
+ @client.call_adyen_api(@service, action, {}, headers, @version)
33
+ end
34
+
35
+ # Get all balance webhook settings
36
+ def get_all_webhook_settings(balance_platform_id, webhook_id, headers: {})
37
+ endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
38
+ endpoint = endpoint.gsub(%r{^/}, '')
39
+ endpoint = format(endpoint, balance_platform_id, webhook_id)
40
+
41
+ action = { method: 'get', url: endpoint }
42
+ @client.call_adyen_api(@service, action, {}, headers, @version)
43
+ end
44
+
45
+ # Get a balance webhook setting by id
46
+ def get_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
47
+ endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
50
+
51
+ action = { method: 'get', url: endpoint }
52
+ @client.call_adyen_api(@service, action, {}, headers, @version)
53
+ end
54
+
55
+ # Update a balance webhook setting by id
56
+ def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, balance_webhook_setting_info_update, headers: {})
57
+ endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
58
+ endpoint = endpoint.gsub(%r{^/}, '')
59
+ endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
60
+
61
+ action = { method: 'patch', url: endpoint }
62
+ @client.call_adyen_api(@service, action, request, headers, @version)
63
+ end
64
+
65
+ end
66
+ end
@@ -12,6 +12,16 @@ module Adyen
12
12
  super(client, version, 'BalancePlatform')
13
13
  end
14
14
 
15
+ # Create network token provisioning data
16
+ def create_network_token_provisioning_data(request, id, headers: {})
17
+ endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint, id)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
15
25
  # Create a payment instrument
16
26
  def create_payment_instrument(request, headers: {})
17
27
  endpoint = '/paymentInstruments'.gsub(/{.+?}/, '%s')
@@ -32,6 +42,16 @@ module Adyen
32
42
  @client.call_adyen_api(@service, action, {}, headers, @version)
33
43
  end
34
44
 
45
+ # Get network token activation data
46
+ def get_network_token_activation_data(id, headers: {})
47
+ endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, id)
50
+
51
+ action = { method: 'get', url: endpoint }
52
+ @client.call_adyen_api(@service, action, {}, headers, @version)
53
+ end
54
+
35
55
  # Get the PAN of a payment instrument
36
56
  def get_pan_of_payment_instrument(id, headers: {})
37
57
  endpoint = '/paymentInstruments/{id}/reveal'.gsub(/{.+?}/, '%s')
@@ -1,5 +1,7 @@
1
1
  require_relative 'balancePlatform/account_holders_api'
2
+ require_relative 'balancePlatform/authorized_card_users_api'
2
3
  require_relative 'balancePlatform/balance_accounts_api'
4
+ require_relative 'balancePlatform/balances_api'
3
5
  require_relative 'balancePlatform/bank_account_validation_api'
4
6
  require_relative 'balancePlatform/card_orders_api'
5
7
  require_relative 'balancePlatform/grant_accounts_api'
@@ -33,10 +35,18 @@ module Adyen
33
35
  @account_holders_api ||= Adyen::AccountHoldersApi.new(@client, @version)
34
36
  end
35
37
 
38
+ def authorized_card_users_api
39
+ @authorized_card_users_api ||= Adyen::AuthorizedCardUsersApi.new(@client, @version)
40
+ end
41
+
36
42
  def balance_accounts_api
37
43
  @balance_accounts_api ||= Adyen::BalanceAccountsApi.new(@client, @version)
38
44
  end
39
45
 
46
+ def balances_api
47
+ @balances_api ||= Adyen::BalancesApi.new(@client, @version)
48
+ end
49
+
40
50
  def bank_account_validation_api
41
51
  @bank_account_validation_api ||= Adyen::BankAccountValidationApi.new(@client, @version)
42
52
  end
@@ -0,0 +1,26 @@
1
+ require_relative '../service'
2
+ module Adyen
3
+
4
+ # NOTE: This class is auto generated by OpenAPI Generator
5
+ # Ref: https://openapi-generator.tech
6
+ #
7
+ # Do not edit the class manually.
8
+ class SessionAuthenticationApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'SessionAuthentication')
13
+ end
14
+
15
+ # Create a session token
16
+ def create_authentication_session(request, authentication_session_request, headers: {})
17
+ endpoint = '/sessions'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'sessionAuthentication/session_authentication_api'
2
+
3
+ module Adyen
4
+
5
+ # NOTE: This class is auto generated by OpenAPI Generator
6
+ # Ref: https://openapi-generator.tech
7
+ #
8
+ # Do not edit the class manually.
9
+ class SessionAuthentication
10
+ attr_accessor :service, :version
11
+
12
+ DEFAULT_VERSION = 1
13
+ def initialize(client, version = DEFAULT_VERSION)
14
+ @service = 'SessionAuthentication'
15
+ @client = client
16
+ @version = version
17
+ end
18
+
19
+ def session_authentication_api
20
+ @session_authentication_api ||= Adyen::SessionAuthenticationApi.new(@client, @version)
21
+ end
22
+
23
+ end
24
+ end
data/lib/adyen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Adyen
2
2
  NAME = 'adyen-ruby-api-library'.freeze
3
- VERSION = '10.2.0'.freeze
3
+ VERSION = '10.4.0'.freeze
4
4
  end
data/spec/client_spec.rb CHANGED
@@ -113,10 +113,20 @@ RSpec.describe Adyen do
113
113
  Adyen::Client.new(env: :test, connection_options: connection_options)
114
114
  end
115
115
 
116
+ # test with Ruby 3.2+ only (where Faraday requestOptions timeout is supported)
116
117
  it 'initiates a Faraday connection with the provided options' do
117
- connection_options = Faraday::ConnectionOptions.new
118
+ skip "Only runs on Ruby >= 3.2" unless RUBY_VERSION >= '3.2'
119
+ connection_options = Faraday::ConnectionOptions.new(
120
+ request: {
121
+ open_timeout: 5,
122
+ timeout: 10
123
+ }
124
+ )
118
125
  expect(Faraday::ConnectionOptions).not_to receive(:new)
119
126
  client = Adyen::Client.new(api_key: 'api_key', env: :mock, connection_options: connection_options)
127
+ # verify custom options
128
+ expect(client.connection_options[:request][:open_timeout]).to eq(5)
129
+ expect(client.connection_options[:request][:timeout]).to eq(10)
120
130
 
121
131
  mock_faraday_connection = double(Faraday::Connection)
122
132
  client.service_url(@shared_values[:service], 'payments/details', client.checkout.version)
@@ -130,6 +140,14 @@ RSpec.describe Adyen do
130
140
  client.checkout.payments_api.payments_details(request_body)
131
141
  end
132
142
 
143
+ # test with Ruby 3.2+ only (where Faraday requestOptions timeout is supported)
144
+ it 'initiates a Faraday connection with the expected default timeouts' do
145
+ skip "Only runs on Ruby >= 3.2" unless RUBY_VERSION >= '3.2'
146
+ client = Adyen::Client.new(env: :test)
147
+ expect(client.connection_options[:request][:open_timeout]).to eq(30)
148
+ expect(client.connection_options[:request][:timeout]).to eq(60)
149
+ end
150
+
133
151
  it "checks the creation of checkout url" do
134
152
  client = Adyen::Client.new(api_key: "api_key", env: :test)
135
153
  expect(client.service_url("Checkout", "paymentMethods", "71")).
@@ -278,4 +296,10 @@ RSpec.describe Adyen do
278
296
  expect(client.service_url('PosMobile', 'sessions', nil))
279
297
  .to eq('https://checkout-test.adyen.com/checkout/possdk/sessions')
280
298
  end
299
+
300
+ it 'correctly maps Disputes to DisputesService and generates valid URL' do
301
+ client = Adyen::Client.new(env: :test)
302
+ expect(client.service_url_base('Disputes'))
303
+ .to eq('https://ca-test.adyen.com/ca/services/DisputesService')
304
+ end
281
305
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adyen-ruby-api-library
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.2.0
4
+ version: 10.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adyen
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: faraday
@@ -109,7 +109,9 @@ files:
109
109
  - lib/adyen/services/balanceControlService.rb
110
110
  - lib/adyen/services/balancePlatform.rb
111
111
  - lib/adyen/services/balancePlatform/account_holders_api.rb
112
+ - lib/adyen/services/balancePlatform/authorized_card_users_api.rb
112
113
  - lib/adyen/services/balancePlatform/balance_accounts_api.rb
114
+ - lib/adyen/services/balancePlatform/balances_api.rb
113
115
  - lib/adyen/services/balancePlatform/bank_account_validation_api.rb
114
116
  - lib/adyen/services/balancePlatform/card_orders_api.rb
115
117
  - lib/adyen/services/balancePlatform/grant_accounts_api.rb
@@ -183,6 +185,8 @@ files:
183
185
  - lib/adyen/services/posTerminalManagement.rb
184
186
  - lib/adyen/services/recurring.rb
185
187
  - lib/adyen/services/service.rb
188
+ - lib/adyen/services/sessionAuthentication.rb
189
+ - lib/adyen/services/sessionAuthentication/session_authentication_api.rb
186
190
  - lib/adyen/services/storedValue.rb
187
191
  - lib/adyen/services/terminalCloudAPI.rb
188
192
  - lib/adyen/services/transfers.rb
@@ -433,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
433
437
  - !ruby/object:Gem::Version
434
438
  version: '0'
435
439
  requirements: []
436
- rubygems_version: 3.6.2
440
+ rubygems_version: 3.6.9
437
441
  specification_version: 4
438
442
  summary: Official Adyen Ruby API Library
439
443
  test_files: []