diff --git a/lib/adyen/services/balancePlatform.rb b/lib/adyen/services/balancePlatform.rb index c5a541d..c7ca25a 100644 --- a/lib/adyen/services/balancePlatform.rb +++ b/lib/adyen/services/balancePlatform.rb @@ -1,4 +1,5 @@ require_relative 'balancePlatform/account_holders_api' +require_relative 'balancePlatform/authorized_card_users_api' require_relative 'balancePlatform/balance_accounts_api' require_relative 'balancePlatform/balances_api' require_relative 'balancePlatform/bank_account_validation_api' @@ -34,6 +35,10 @@ def account_holders_api @account_holders_api ||= Adyen::AccountHoldersApi.new(@client, @version) end + def authorized_card_users_api + @authorized_card_users_api ||= Adyen::AuthorizedCardUsersApi.new(@client, @version) + end + def balance_accounts_api @balance_accounts_api ||= Adyen::BalanceAccountsApi.new(@client, @version) end diff --git a/lib/adyen/services/balancePlatform/authorized_card_users_api.rb b/lib/adyen/services/balancePlatform/authorized_card_users_api.rb new file mode 100644 index 0000000..ab619b5 --- /dev/null +++ b/lib/adyen/services/balancePlatform/authorized_card_users_api.rb @@ -0,0 +1,56 @@ +require_relative '../service' +module Adyen + + # NOTE: This class is auto generated by OpenAPI Generator + # Ref: https://openapi-generator.tech + # + # Do not edit the class manually. + class AuthorizedCardUsersApi < Service + attr_accessor :service, :version + + def initialize(client, version = DEFAULT_VERSION) + super(client, version, 'BalancePlatform') + end + + # Create authorized users for a card. + def create_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {}) + endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, payment_instrument_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + # Delete the authorized users for a card. + def delete_authorised_card_users(payment_instrument_id, headers: {}) + endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, payment_instrument_id) + + action = { method: 'delete', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Get authorized users for a card. + def get_all_authorised_card_users(payment_instrument_id, headers: {}) + endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, payment_instrument_id) + + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + + # Update the authorized users for a card. + def update_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {}) + endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, payment_instrument_id) + + action = { method: 'patch', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + + end +end diff --git a/lib/adyen/services/balancePlatform/payment_instruments_api.rb b/lib/adyen/services/balancePlatform/payment_instruments_api.rb index 83b8d95..5a00da9 100644 --- a/lib/adyen/services/balancePlatform/payment_instruments_api.rb +++ b/lib/adyen/services/balancePlatform/payment_instruments_api.rb @@ -12,6 +12,16 @@ def initialize(client, version = DEFAULT_VERSION) super(client, version, 'BalancePlatform') end + # Create network token activation data + def create_network_token_activation_data(request, id, headers: {}) + endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + # Create a payment instrument def create_payment_instrument(request, headers: {}) endpoint = '/paymentInstruments'.gsub(/{.+?}/, '%s') @@ -32,6 +42,16 @@ def get_all_transaction_rules_for_payment_instrument(id, headers: {}) @client.call_adyen_api(@service, action, {}, headers, @version) end + # Get network token activation data + def get_network_token_activation_data(id, headers: {}) + endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, id) + + action = { method: 'get', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + # Get the PAN of a payment instrument def get_pan_of_payment_instrument(id, headers: {}) endpoint = '/paymentInstruments/{id}/reveal'.gsub(/{.+?}/, '%s')