Skip to content

Commit 757b684

Browse files
[create-pull-request] automated change (#159)
1 parent 9763eb9 commit 757b684

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

lib/adyen/services/balancePlatform.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require_relative 'balancePlatform/bank_account_validation_api'
44
require_relative 'balancePlatform/grant_accounts_api'
55
require_relative 'balancePlatform/grant_offers_api'
6+
require_relative 'balancePlatform/network_tokens_api'
67
require_relative 'balancePlatform/payment_instrument_groups_api'
78
require_relative 'balancePlatform/payment_instruments_api'
89
require_relative 'balancePlatform/platform_api'
@@ -39,6 +40,10 @@ def grant_offers_api
3940
@grant_offers_api ||= Adyen::GrantOffersApi.new(@client, @version)
4041
end
4142

43+
def network_tokens_api
44+
@network_tokens_api ||= Adyen::NetworkTokensApi.new(@client, @version)
45+
end
46+
4247
def payment_instrument_groups_api
4348
@payment_instrument_groups_api ||= Adyen::PaymentInstrumentGroupsApi.new(@client, @version)
4449
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
require_relative '../service'
2+
module Adyen
3+
class NetworkTokensApi < Service
4+
attr_accessor :service, :version
5+
6+
def initialize(client, version = DEFAULT_VERSION)
7+
super(client, version, 'BalancePlatform')
8+
end
9+
10+
def get_network_token(network_token_id, headers: {})
11+
endpoint = '/networkTokens/{networkTokenId}'.gsub(/{.+?}/, '%s')
12+
endpoint = endpoint.gsub(%r{^/}, '')
13+
endpoint = format(endpoint, network_token_id)
14+
15+
action = { method: 'get', url: endpoint }
16+
@client.call_adyen_api(@service, action, {}, headers, @version)
17+
end
18+
19+
def update_network_token(request, network_token_id, headers: {})
20+
endpoint = '/networkTokens/{networkTokenId}'.gsub(/{.+?}/, '%s')
21+
endpoint = endpoint.gsub(%r{^/}, '')
22+
endpoint = format(endpoint, network_token_id)
23+
24+
action = { method: 'patch', url: endpoint }
25+
@client.call_adyen_api(@service, action, request, headers, @version)
26+
end
27+
28+
end
29+
end

lib/adyen/services/balancePlatform/payment_instruments_api.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ def get_payment_instrument(id, headers: {})
1616
@client.call_adyen_api(@service, action, {}, headers, @version)
1717
end
1818

19+
def list_network_tokens(id, headers: {})
20+
endpoint = '/paymentInstruments/{id}/networkTokens'.gsub(/{.+?}/, '%s')
21+
endpoint = endpoint.gsub(%r{^/}, '')
22+
endpoint = format(endpoint, id)
23+
24+
action = { method: 'get', url: endpoint }
25+
@client.call_adyen_api(@service, action, {}, headers, @version)
26+
end
27+
1928
def get_pan_of_payment_instrument(id, headers: {})
2029
endpoint = '/paymentInstruments/{id}/reveal'.gsub(/{.+?}/, '%s')
2130
endpoint = endpoint.gsub(%r{^/}, '')

lib/adyen/services/checkout/recurring_api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ def initialize(client, version = DEFAULT_VERSION)
77
super(client, version, 'Checkout')
88
end
99

10-
def delete_token_for_stored_payment_details(recurring_id, headers: {}, query_params: {})
11-
endpoint = '/storedPaymentMethods/{recurringId}'.gsub(/{.+?}/, '%s')
10+
def delete_token_for_stored_payment_details(stored_payment_method_id, headers: {}, query_params: {})
11+
endpoint = '/storedPaymentMethods/{storedPaymentMethodId}'.gsub(/{.+?}/, '%s')
1212
endpoint = endpoint.gsub(%r{^/}, '')
13-
endpoint = format(endpoint, recurring_id)
13+
endpoint = format(endpoint, stored_payment_method_id)
1414
endpoint += create_query_string(query_params)
1515
action = { method: 'delete', url: endpoint }
1616
@client.call_adyen_api(@service, action, {}, headers, @version)

0 commit comments

Comments
 (0)