diff --git a/Makefile b/Makefile index 032af399..0645d0c4 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ posTerminalManagement: spec=TfmAPIService-v1 payment: spec=PaymentService-v68 recurring: spec=RecurringService-v68 payout: spec=PayoutService-v68 -management: spec=ManagementService-v1 +management: spec=ManagementService-v3 legalEntityManagement: spec=LegalEntityService-v3 balancePlatform: spec=BalancePlatformService-v2 balanceControlService: spec=BalanceControlService-v1 -transfers: spec=TransferService-v3 +transfers: spec=TransferService-v4 disputes: spec=DisputeService-v30 allServices: $(services) $(singleFileServices) diff --git a/README.md b/README.md index 116f51c6..6abec727 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ This library supports the following: | [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](lib/adyen/services/balancePlatform.rb) | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](lib/adyen/services/dataProtection.rb) | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v3 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) | -| [Management API](https://docs.adyen.com/api-explorer/Management/1/overview) | v1 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) | +| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | v68 | Our classic integration for online payments. | [Classic Integration API](lib/adyen/services/payment.rb) | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | v68 | Endpoints for sending funds to your customers. | [Payout](lib/adyen/services/payout.rb) | | [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | v1 | Endpoints for managing your point-of-sale payment terminals. | [TerminalManagement](lib/adyen/services/posTerminalManagement.rb) | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](lib/adyen/services/recurring.rb) | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | v46 | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](lib/adyen/services/storedValue.rb) | -| [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | v3 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](lib/adyen/services/transfers.rb) | +| [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | v4 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](lib/adyen/services/transfers.rb) | | [Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/terminal-api-reference/) | - | Our point-of-sale integration. | [TerminalCloudAPI](lib/adyen/services/terminalCloudAPI.rb) | | [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | v30 | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](lib/adyen/services/disputes.rb) | diff --git a/lib/adyen/services/management.rb b/lib/adyen/services/management.rb index f83fcc44..2ca427ae 100644 --- a/lib/adyen/services/management.rb +++ b/lib/adyen/services/management.rb @@ -32,7 +32,7 @@ module Adyen class Management attr_accessor :service, :version - DEFAULT_VERSION = 1 + DEFAULT_VERSION = 3 def initialize(client, version = DEFAULT_VERSION) @service = 'Management' @client = client diff --git a/lib/adyen/services/management/android_files_company_level_api.rb b/lib/adyen/services/management/android_files_company_level_api.rb index c0c2c55c..8c599fdf 100644 --- a/lib/adyen/services/management/android_files_company_level_api.rb +++ b/lib/adyen/services/management/android_files_company_level_api.rb @@ -34,5 +34,14 @@ def list_android_certificates(company_id, headers: {}, query_params: {}) @client.call_adyen_api(@service, action, {}, headers, @version) end + def upload_android_app(company_id, headers: {}) + endpoint = '/companies/{companyId}/androidApps'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, company_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + end end diff --git a/lib/adyen/services/management/my_api_credential_api.rb b/lib/adyen/services/management/my_api_credential_api.rb index fcad45ae..180d2c12 100644 --- a/lib/adyen/services/management/my_api_credential_api.rb +++ b/lib/adyen/services/management/my_api_credential_api.rb @@ -52,5 +52,14 @@ def add_allowed_origin(request, headers: {}) @client.call_adyen_api(@service, action, request, headers, @version) end + def generate_new_client_key_for_self(headers: {}) + endpoint = '/me/generateClientKey'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, {}, headers, @version) + end + end end diff --git a/lib/adyen/services/management/terminals_terminal_level_api.rb b/lib/adyen/services/management/terminals_terminal_level_api.rb index 289d878f..d195e4e1 100644 --- a/lib/adyen/services/management/terminals_terminal_level_api.rb +++ b/lib/adyen/services/management/terminals_terminal_level_api.rb @@ -16,5 +16,14 @@ def list_terminals(headers: {}, query_params: {}) @client.call_adyen_api(@service, action, {}, headers, @version) end + def reassign_terminal(request, terminal_id, headers: {}) + endpoint = '/terminals/{terminalId}/reassign'.gsub(/{.+?}/, '%s') + endpoint = endpoint.gsub(%r{^/}, '') + endpoint = format(endpoint, terminal_id) + + action = { method: 'post', url: endpoint } + @client.call_adyen_api(@service, action, request, headers, @version) + end + end end diff --git a/lib/adyen/services/transfers.rb b/lib/adyen/services/transfers.rb index 4301cd41..edd68eb8 100644 --- a/lib/adyen/services/transfers.rb +++ b/lib/adyen/services/transfers.rb @@ -6,7 +6,7 @@ module Adyen class Transfers attr_accessor :service, :version - DEFAULT_VERSION = 3 + DEFAULT_VERSION = 4 def initialize(client, version = DEFAULT_VERSION) @service = 'Transfers' @client = client diff --git a/lib/adyen/services/transfers/transfers_api.rb b/lib/adyen/services/transfers/transfers_api.rb index 683b0db2..6aaac03a 100644 --- a/lib/adyen/services/transfers/transfers_api.rb +++ b/lib/adyen/services/transfers/transfers_api.rb @@ -16,5 +16,14 @@ def transfer_funds(request, headers: {}) @client.call_adyen_api(@service, action, request, headers, @version) end + def return_transfer(request, id, headers: {}) + endpoint = '/transfers/{id}/returns'.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 + end end