adyen-ruby-api-library 10.3.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 +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/adyen/client.rb +12 -1
- data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +56 -0
- data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +20 -0
- data/lib/adyen/services/balancePlatform.rb +5 -0
- data/lib/adyen/version.rb +1 -1
- data/spec/client_spec.rb +19 -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: 2c646e26363f5d6c02a69b973a8afad037355e531c284d55589d540f621b84ca
|
4
|
+
data.tar.gz: 619550bc5183dcb47050f01d774590b9b50b431fcc32fbdaed09a786e8f13a77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f4544d2cf7b59ec1deceae8c43168e0cda341c3cd7153533579ac3df3bb4663771d4ea24e8feb70f9429c993c7ee7eefc34f4ef867ab968034b2831a5eaa00
|
7
|
+
data.tar.gz: c8ad57af40a03bf3728ddb987f55afe2d5373f94b7106e7cc6db2dcce6cef78e58b1850ac3325e20b6fa79b0cd927e1898d203a4c20ea8db57d5892d4d60789b
|
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
10.
|
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
|
-
|
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
|
|
@@ -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
|
@@ -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,4 +1,5 @@
|
|
1
1
|
require_relative 'balancePlatform/account_holders_api'
|
2
|
+
require_relative 'balancePlatform/authorized_card_users_api'
|
2
3
|
require_relative 'balancePlatform/balance_accounts_api'
|
3
4
|
require_relative 'balancePlatform/balances_api'
|
4
5
|
require_relative 'balancePlatform/bank_account_validation_api'
|
@@ -34,6 +35,10 @@ module Adyen
|
|
34
35
|
@account_holders_api ||= Adyen::AccountHoldersApi.new(@client, @version)
|
35
36
|
end
|
36
37
|
|
38
|
+
def authorized_card_users_api
|
39
|
+
@authorized_card_users_api ||= Adyen::AuthorizedCardUsersApi.new(@client, @version)
|
40
|
+
end
|
41
|
+
|
37
42
|
def balance_accounts_api
|
38
43
|
@balance_accounts_api ||= Adyen::BalanceAccountsApi.new(@client, @version)
|
39
44
|
end
|
data/lib/adyen/version.rb
CHANGED
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
|
-
|
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")).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adyen-ruby-api-library
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.
|
4
|
+
version: 10.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adyen
|
@@ -109,6 +109,7 @@ 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
|
113
114
|
- lib/adyen/services/balancePlatform/balances_api.rb
|
114
115
|
- lib/adyen/services/balancePlatform/bank_account_validation_api.rb
|
@@ -436,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
436
437
|
- !ruby/object:Gem::Version
|
437
438
|
version: '0'
|
438
439
|
requirements: []
|
439
|
-
rubygems_version: 3.6.
|
440
|
+
rubygems_version: 3.6.9
|
440
441
|
specification_version: 4
|
441
442
|
summary: Official Adyen Ruby API Library
|
442
443
|
test_files: []
|