From a6a73ceb0d65029c05f3cb4735b466f103ebb221 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:41:44 +0200 Subject: [PATCH 1/2] Improve the templates (#263) * new templates finish fixing uts * Update DataProtectionTest.py * Update DetermineEndpointTest.py * update unit tests * added version back to client removed checkout utility version as these endpoints are still available on v70, added the versions back to the client to avoid breaking changes --- Adyen/client.py | 200 +++++++----------- .../balancePlatform/account_holders_api.py | 9 +- .../balancePlatform/balance_accounts_api.py | 19 +- .../bank_account_validation_api.py | 3 +- .../balancePlatform/grant_accounts_api.py | 3 +- .../balancePlatform/grant_offers_api.py | 5 +- .../payment_instrument_groups_api.py | 7 +- .../payment_instruments_api.py | 11 +- .../services/balancePlatform/platform_api.py | 5 +- .../balancePlatform/transaction_rules_api.py | 9 +- Adyen/services/binlookup.py | 5 +- .../checkout/classic_checkout_sdk_api.py | 5 +- Adyen/services/checkout/modifications_api.py | 13 +- Adyen/services/checkout/orders_api.py | 7 +- Adyen/services/checkout/payment_links_api.py | 7 +- Adyen/services/checkout/payments_api.py | 21 +- Adyen/services/checkout/recurring_api.py | 5 +- Adyen/services/checkout/utility_api.py | 5 +- Adyen/services/dataProtection.py | 3 +- .../business_lines_api.py | 9 +- .../legalEntityManagement/documents_api.py | 9 +- .../hosted_onboarding_api.py | 7 +- .../legal_entities_api.py | 11 +- .../pci_questionnaires_api.py | 9 +- .../terms_of_service_api.py | 15 +- .../transfer_instruments_api.py | 9 +- Adyen/services/management/__init__.py | 2 - .../management/account_company_level_api.py | 7 +- .../management/account_merchant_level_api.py | 9 +- .../management/account_store_level_api.py | 17 +- .../allowed_origins_company_level_api.py | 9 +- .../allowed_origins_merchant_level_api.py | 9 +- .../api_credentials_company_level_api.py | 9 +- .../api_credentials_merchant_level_api.py | 9 +- .../management/api_key_company_level_api.py | 3 +- .../management/api_key_merchant_level_api.py | 3 +- .../client_key_company_level_api.py | 3 +- .../client_key_merchant_level_api.py | 3 +- .../management/my_api_credential_api.py | 11 +- .../payment_methods_merchant_level_api.py | 13 +- .../payout_settings_merchant_level_api.py | 11 +- .../split_configuration_merchant_level_api.py | 86 -------- .../terminal_actions_company_level_api.py | 9 +- .../terminal_actions_terminal_level_api.py | 3 +- .../terminal_orders_company_level_api.py | 21 +- .../terminal_orders_merchant_level_api.py | 21 +- .../terminal_settings_company_level_api.py | 9 +- .../terminal_settings_merchant_level_api.py | 9 +- .../terminal_settings_store_level_api.py | 17 +- .../terminal_settings_terminal_level_api.py | 9 +- .../terminals_terminal_level_api.py | 3 +- .../management/users_company_level_api.py | 9 +- .../management/users_merchant_level_api.py | 9 +- .../management/webhooks_company_level_api.py | 15 +- .../management/webhooks_merchant_level_api.py | 15 +- Adyen/services/payments/general_api.py | 11 +- Adyen/services/payments/modifications_api.py | 17 +- Adyen/services/payouts/initialization_api.py | 7 +- Adyen/services/payouts/instant_payouts_api.py | 3 +- Adyen/services/payouts/reviewing_api.py | 5 +- Adyen/services/recurring.py | 13 +- Adyen/services/storedValue.py | 13 +- Adyen/services/terminal.py | 11 +- Adyen/services/transfers/__init__.py | 2 - Adyen/services/transfers/capital_api.py | 38 ---- Adyen/services/transfers/transactions_api.py | 5 +- Adyen/services/transfers/transfers_api.py | 3 +- Adyen/settings.py | 27 --- templates/api-small.mustache | 3 +- templates/api.mustache | 3 +- test/BinLookupTest.py | 2 +- test/CheckoutTest.py | 22 +- test/CheckoutUtilityTest.py | 6 +- test/ConfigurationTest.py | 14 +- test/DataProtectionTest.py | 4 +- test/DetermineEndpointTest.py | 62 +++--- test/LegalEntityManagementTest.py | 10 +- test/ManagementTest.py | 12 +- test/RecurringTest.py | 6 +- test/StoredValueTest.py | 14 +- test/TerminalTest.py | 14 +- test/ThirdPartyPayoutTest.py | 14 +- test/TransfersTest.py | 8 +- test/UtilTest.py | 32 ++- 84 files changed, 496 insertions(+), 649 deletions(-) delete mode 100644 Adyen/services/management/split_configuration_merchant_level_api.py delete mode 100644 Adyen/services/transfers/capital_api.py diff --git a/Adyen/client.py b/Adyen/client.py index 6c6a87ce..3447ad09 100644 --- a/Adyen/client.py +++ b/Adyen/client.py @@ -16,7 +16,7 @@ AdyenAPIUnprocessableEntity, AdyenEndpointInvalidFormat) from . import settings -from re import match +import re class AdyenResult(object): @@ -84,7 +84,6 @@ def __init__( live_endpoint_prefix=None, http_timeout=30, api_bin_lookup_version=None, - api_checkout_utility_version=None, api_checkout_version=None, api_management_version=None, api_payment_version=None, @@ -96,6 +95,7 @@ def __init__( api_transfers_version=None, api_stored_value_version=None, api_balance_platform_version=None, + ): self.username = username self.password = password @@ -115,130 +115,41 @@ def __init__( self.http_force = http_force self.live_endpoint_prefix = live_endpoint_prefix self.http_timeout = http_timeout - self.api_bin_lookup_version = api_bin_lookup_version or settings.API_BIN_LOOKUP_VERSION - self.api_checkout_utility_version = api_checkout_utility_version or settings.API_CHECKOUT_UTILITY_VERSION - self.api_checkout_version = api_checkout_version or settings.API_CHECKOUT_VERSION - self.api_management_version = api_management_version or settings.API_MANAGEMENT_VERSION - self.api_payment_version = api_payment_version or settings.API_PAYMENT_VERSION - self.api_payout_version = api_payout_version or settings.API_PAYOUT_VERSION - self.api_recurring_version = api_recurring_version or settings.API_RECURRING_VERSION - self.api_terminal_version = api_terminal_version or settings.API_TERMINAL_VERSION - self.api_legal_entity_management_version = api_legal_entity_management_version or settings.API_LEGAL_ENTITY_MANAGEMENT_VERSION - self.api_data_protection_version = api_data_protection_version or settings.API_DATA_PROTECION_VERSION - self.api_transfers_version = api_transfers_version or settings.API_TRANSFERS_VERSION - self.api_stored_value_version = api_stored_value_version or settings.API_STORED_VALUE_VERSION - self.api_balance_platform_version = api_balance_platform_version or settings.API_BALANCE_PLATFORM_VERSION - - def _determine_base_url_and_version(self, platform, service): - - live_pal_url = settings.PAL_LIVE_ENDPOINT_URL_TEMPLATE - live_checkout_url = settings.ENDPOINT_CHECKOUT_LIVE_SUFFIX - - if platform == 'live' and self.live_endpoint_prefix: - live_pal_url = live_pal_url.format(live_prefix=self.live_endpoint_prefix) - live_checkout_url = live_checkout_url.format(live_prefix=self.live_endpoint_prefix) - - versions_and_urls = { - 'recurring': { - 'version': self.api_recurring_version, - 'base_url': { - 'live': live_pal_url + '/Recurring', - 'test': settings.PAL_TEST_URL + '/Recurring', - } - }, - 'payouts': { - 'version': self.api_payout_version, - 'base_url': { - 'live': live_pal_url + '/Payout', - 'test': settings.PAL_TEST_URL + '/Payout' - } - }, - 'binlookup': { - 'version': self.api_bin_lookup_version, - 'base_url': { - 'live': live_pal_url + '/BinLookup', - 'test': settings.PAL_TEST_URL + '/BinLookup' - } - }, - 'terminal': { - 'version': self.api_terminal_version, - 'base_url': { - 'live': settings.BASE_TERMINAL_URL.format(platform), - 'test': settings.BASE_TERMINAL_URL.format(platform) - } - }, - 'payments': { - 'version': self.api_payment_version, - 'base_url': { - 'live': live_pal_url + '/Payment', - 'test': settings.PAL_TEST_URL + '/Payment' - } - }, - 'checkout': { - 'version': self.api_checkout_version, - 'base_url': { - 'live': live_checkout_url, - 'test': settings.ENDPOINT_CHECKOUT_TEST - } - }, - 'management': { - 'version': self.api_management_version, - 'base_url': { - 'live': settings.BASE_MANAGEMENT_URL.format(platform), - 'test': settings.BASE_MANAGEMENT_URL.format(platform) - } - }, - 'legalEntityManagement': { - 'version': self.api_legal_entity_management_version, - 'base_url': { - 'live': settings.BASE_LEGAL_ENTITY_MANAGEMENT_URL.format(platform), - 'test': settings.BASE_LEGAL_ENTITY_MANAGEMENT_URL.format(platform) - }, - }, - 'balancePlatform': { - 'version': self.api_balance_platform_version, - 'base_url': { - 'live': settings.BASE_CONFIGURATION_URL.format(platform), - 'test': settings.BASE_CONFIGURATION_URL.format(platform) - } - }, - 'dataProtection': { - 'version': self.api_data_protection_version, - 'base_url': { - 'live': settings.BASE_DATA_PROTECION_URL.format(platform), - 'test': settings.BASE_DATA_PROTECION_URL.format(platform) - } - }, - 'transfers': { - 'version': self.api_transfers_version, - 'base_url': { - 'live': settings.BASE_BTL_URL.format(platform), - 'test': settings.BASE_BTL_URL.format(platform) - } - }, - 'storedValue': { - 'version': self.api_stored_value_version, - 'base_url': { - 'live': settings.BASE_STORED_VALUE_URL.format(platform), - 'test': settings.BASE_STORED_VALUE_URL.format(platform) - } - }, - } - - version = versions_and_urls[service]['version'] - base_url = versions_and_urls[service]['base_url'][platform] - # Match urls that require a live prefix and do not have one - - if platform == 'live' and '{live_prefix}' in base_url: - errorstring = "Please set your live suffix. You can set it by running " \ - "adyen.client.live_endpoint_prefix = 'Your live suffix'" - raise AdyenEndpointInvalidFormat(errorstring) - - return version, base_url - - def _determine_api_url(self, platform, service, endpoint): - api_version, base_url = self._determine_base_url_and_version(platform, service) - return base_url + '/' + api_version + endpoint + self.api_bin_lookup_version = api_bin_lookup_version + self.api_checkout_version = api_checkout_version + self.api_management_version = api_management_version + self.api_payment_version = api_payment_version + self.api_payout_version = api_payout_version + self.api_recurring_version = api_recurring_version + self.api_terminal_version = api_terminal_version + self.api_legal_entity_management_version = api_legal_entity_management_version + self.api_data_protection_version = api_data_protection_version + self.api_transfers_version = api_transfers_version + self.api_stored_value_version = api_stored_value_version + self.api_balance_platform_version = api_balance_platform_version + + def _determine_api_url(self, platform, endpoint): + if platform == "test": + return endpoint + + if "pal-" in endpoint: + if self.live_endpoint_prefix is None: + error_string = "Please set your live suffix. You can set it by running " \ + "adyen.client.live_endpoint_prefix = 'Your live suffix'" + raise AdyenEndpointInvalidFormat(error_string) + endpoint = endpoint.replace("https://pal-test.adyen.com/pal/servlet/", + "https://" + self.live_endpoint_prefix + "-pal-live.adyenpayments.com/pal/servlet/") + elif "checkout-" in endpoint: + if self.live_endpoint_prefix is None: + error_string = "Please set your live suffix. You can set it by running " \ + "adyen.client.live_endpoint_prefix = 'Your live suffix'" + raise AdyenEndpointInvalidFormat(error_string) + endpoint = endpoint.replace("https://checkout-test.adyen.com/", + "https://" + self.live_endpoint_prefix + "-checkout-live.adyenpayments.com/checkout/") + + endpoint = endpoint.replace("-test", "-live") + + return endpoint def _review_payout_username(self, **kwargs): if 'username' in kwargs: @@ -351,6 +262,24 @@ def _set_platform(self, **kwargs): return platform + def _set_url_version(self, service, endpoint): + version_lookup = {"binlookup": self.api_bin_lookup_version, + "checkout": self.api_checkout_version, + "management": self.api_management_version, + "payments": self.api_payment_version, + "payouts": self.api_payout_version, + "recurring": self.api_recurring_version, + "terminal": self.api_terminal_version, + "legalEntityManagement": self.api_legal_entity_management_version, + "dataProtection": self.api_data_protection_version, + "transfers": self.api_transfers_version, + "storedValue": self.api_stored_value_version, + "balancePlatform": self.api_balance_platform_version} + + new_version = f"v{version_lookup[service]}" + endpoint = re.sub(r'\.com/v\d{1,2}', f".com/{new_version}", endpoint) + return endpoint + def call_adyen_api( self, request_data, @@ -383,10 +312,25 @@ def call_adyen_api( self._init_http_client() # Set credentials - xapikey, username, password, kwargs= self._set_credentials(service, endpoint, **kwargs) + xapikey, username, password, kwargs = self._set_credentials(service, endpoint, **kwargs) # Set platform platform = self._set_platform(**kwargs) message = request_data + # Set version (if not default one) + versions = [self.api_bin_lookup_version, + self.api_checkout_version, + self.api_management_version, + self.api_payment_version, + self.api_payout_version, + self.api_recurring_version, + self.api_terminal_version, + self.api_legal_entity_management_version, + self.api_data_protection_version, + self.api_transfers_version, + self.api_stored_value_version, + self.api_balance_platform_version] + if any(versions): + endpoint = self._set_url_version(service, endpoint) headers = { self.APPLICATION_INFO_HEADER_NAME: settings.LIB_NAME, @@ -398,7 +342,7 @@ def call_adyen_api( if idempotency_key: headers[self.IDEMPOTENCY_HEADER_NAME] = idempotency_key - url = self._determine_api_url(platform, service, endpoint) + url = self._determine_api_url(platform, endpoint) if 'query_parameters' in kwargs: url = url + util.get_query(kwargs['query_parameters']) diff --git a/Adyen/services/balancePlatform/account_holders_api.py b/Adyen/services/balancePlatform/account_holders_api.py index 7914dd6e..2e070338 100644 --- a/Adyen/services/balancePlatform/account_holders_api.py +++ b/Adyen/services/balancePlatform/account_holders_api.py @@ -11,12 +11,13 @@ class AccountHoldersApi(AdyenServiceBase): def __init__(self, client=None): super(AccountHoldersApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_account_holder(self, id, idempotency_key=None, **kwargs): """ Get an account holder """ - endpoint = f"/accountHolders/{id}" + endpoint = self.baseUrl + f"/accountHolders/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_all_balance_accounts_of_account_holder(self, id, idempotency_key=None, * """ Get all balance accounts of an account holder """ - endpoint = f"/accountHolders/{id}/balanceAccounts" + endpoint = self.baseUrl + f"/accountHolders/{id}/balanceAccounts" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_account_holder(self, request, id, idempotency_key=None, **kwargs): """ Update an account holder """ - endpoint = f"/accountHolders/{id}" + endpoint = self.baseUrl + f"/accountHolders/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_account_holder(self, request, idempotency_key=None, **kwargs): """ Create an account holder """ - endpoint = f"/accountHolders" + endpoint = self.baseUrl + f"/accountHolders" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/balance_accounts_api.py b/Adyen/services/balancePlatform/balance_accounts_api.py index 40882f7d..cf0247ea 100644 --- a/Adyen/services/balancePlatform/balance_accounts_api.py +++ b/Adyen/services/balancePlatform/balance_accounts_api.py @@ -11,12 +11,13 @@ class BalanceAccountsApi(AdyenServiceBase): def __init__(self, client=None): super(BalanceAccountsApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def delete_sweep(self, balanceAccountId, sweepId, idempotency_key=None, **kwargs): """ Delete a sweep """ - endpoint = f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" + endpoint = self.baseUrl + f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_all_sweeps_for_balance_account(self, balanceAccountId, idempotency_key=N """ Get all sweeps for a balance account """ - endpoint = f"/balanceAccounts/{balanceAccountId}/sweeps" + endpoint = self.baseUrl + f"/balanceAccounts/{balanceAccountId}/sweeps" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_sweep(self, balanceAccountId, sweepId, idempotency_key=None, **kwargs): """ Get a sweep """ - endpoint = f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" + endpoint = self.baseUrl + f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_balance_account(self, id, idempotency_key=None, **kwargs): """ Get a balance account """ - endpoint = f"/balanceAccounts/{id}" + endpoint = self.baseUrl + f"/balanceAccounts/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def get_all_payment_instruments_for_balance_account(self, id, idempotency_key=No """ Get all payment instruments for a balance account """ - endpoint = f"/balanceAccounts/{id}/paymentInstruments" + endpoint = self.baseUrl + f"/balanceAccounts/{id}/paymentInstruments" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def update_sweep(self, request, balanceAccountId, sweepId, idempotency_key=None, """ Update a sweep """ - endpoint = f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" + endpoint = self.baseUrl + f"/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def update_balance_account(self, request, id, idempotency_key=None, **kwargs): """ Update a balance account """ - endpoint = f"/balanceAccounts/{id}" + endpoint = self.baseUrl + f"/balanceAccounts/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def create_balance_account(self, request, idempotency_key=None, **kwargs): """ Create a balance account """ - endpoint = f"/balanceAccounts" + endpoint = self.baseUrl + f"/balanceAccounts" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -80,7 +81,7 @@ def create_sweep(self, request, balanceAccountId, idempotency_key=None, **kwargs """ Create a sweep """ - endpoint = f"/balanceAccounts/{balanceAccountId}/sweeps" + endpoint = self.baseUrl + f"/balanceAccounts/{balanceAccountId}/sweeps" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/bank_account_validation_api.py b/Adyen/services/balancePlatform/bank_account_validation_api.py index bdb07fa0..588a1864 100644 --- a/Adyen/services/balancePlatform/bank_account_validation_api.py +++ b/Adyen/services/balancePlatform/bank_account_validation_api.py @@ -11,12 +11,13 @@ class BankAccountValidationApi(AdyenServiceBase): def __init__(self, client=None): super(BankAccountValidationApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def validate_bank_account_identification(self, request, idempotency_key=None, **kwargs): """ Validate a bank account """ - endpoint = f"/validateBankAccountIdentification" + endpoint = self.baseUrl + f"/validateBankAccountIdentification" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/grant_accounts_api.py b/Adyen/services/balancePlatform/grant_accounts_api.py index dcda2ae5..1eecce8d 100644 --- a/Adyen/services/balancePlatform/grant_accounts_api.py +++ b/Adyen/services/balancePlatform/grant_accounts_api.py @@ -11,12 +11,13 @@ class GrantAccountsApi(AdyenServiceBase): def __init__(self, client=None): super(GrantAccountsApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_grant_account(self, id, idempotency_key=None, **kwargs): """ Get a grant account """ - endpoint = f"/grantAccounts/{id}" + endpoint = self.baseUrl + f"/grantAccounts/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/grant_offers_api.py b/Adyen/services/balancePlatform/grant_offers_api.py index 6a3a45ca..b94ecae5 100644 --- a/Adyen/services/balancePlatform/grant_offers_api.py +++ b/Adyen/services/balancePlatform/grant_offers_api.py @@ -11,12 +11,13 @@ class GrantOffersApi(AdyenServiceBase): def __init__(self, client=None): super(GrantOffersApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_all_available_grant_offers(self, idempotency_key=None, **kwargs): """ Get all available grant offers """ - endpoint = f"/grantOffers" + endpoint = self.baseUrl + f"/grantOffers" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_grant_offer(self, grantOfferId, idempotency_key=None, **kwargs): """ Get a grant offer """ - endpoint = f"/grantOffers/{grantOfferId}" + endpoint = self.baseUrl + f"/grantOffers/{grantOfferId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/payment_instrument_groups_api.py b/Adyen/services/balancePlatform/payment_instrument_groups_api.py index 3fff153e..5c2d4565 100644 --- a/Adyen/services/balancePlatform/payment_instrument_groups_api.py +++ b/Adyen/services/balancePlatform/payment_instrument_groups_api.py @@ -11,12 +11,13 @@ class PaymentInstrumentGroupsApi(AdyenServiceBase): def __init__(self, client=None): super(PaymentInstrumentGroupsApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_payment_instrument_group(self, id, idempotency_key=None, **kwargs): """ Get a payment instrument group """ - endpoint = f"/paymentInstrumentGroups/{id}" + endpoint = self.baseUrl + f"/paymentInstrumentGroups/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_all_transaction_rules_for_payment_instrument_group(self, id, idempotency """ Get all transaction rules for a payment instrument group """ - endpoint = f"/paymentInstrumentGroups/{id}/transactionRules" + endpoint = self.baseUrl + f"/paymentInstrumentGroups/{id}/transactionRules" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def create_payment_instrument_group(self, request, idempotency_key=None, **kwarg """ Create a payment instrument group """ - endpoint = f"/paymentInstrumentGroups" + endpoint = self.baseUrl + f"/paymentInstrumentGroups" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/payment_instruments_api.py b/Adyen/services/balancePlatform/payment_instruments_api.py index 0045f431..65adf045 100644 --- a/Adyen/services/balancePlatform/payment_instruments_api.py +++ b/Adyen/services/balancePlatform/payment_instruments_api.py @@ -11,12 +11,13 @@ class PaymentInstrumentsApi(AdyenServiceBase): def __init__(self, client=None): super(PaymentInstrumentsApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_payment_instrument(self, id, idempotency_key=None, **kwargs): """ Get a payment instrument """ - endpoint = f"/paymentInstruments/{id}" + endpoint = self.baseUrl + f"/paymentInstruments/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_pan_of_payment_instrument(self, id, idempotency_key=None, **kwargs): """ Get the PAN of a payment instrument """ - endpoint = f"/paymentInstruments/{id}/reveal" + endpoint = self.baseUrl + f"/paymentInstruments/{id}/reveal" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_all_transaction_rules_for_payment_instrument(self, id, idempotency_key=N """ Get all transaction rules for a payment instrument """ - endpoint = f"/paymentInstruments/{id}/transactionRules" + endpoint = self.baseUrl + f"/paymentInstruments/{id}/transactionRules" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_payment_instrument(self, request, id, idempotency_key=None, **kwargs) """ Update a payment instrument """ - endpoint = f"/paymentInstruments/{id}" + endpoint = self.baseUrl + f"/paymentInstruments/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def create_payment_instrument(self, request, idempotency_key=None, **kwargs): """ Create a payment instrument """ - endpoint = f"/paymentInstruments" + endpoint = self.baseUrl + f"/paymentInstruments" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/platform_api.py b/Adyen/services/balancePlatform/platform_api.py index 96ca9255..c407612a 100644 --- a/Adyen/services/balancePlatform/platform_api.py +++ b/Adyen/services/balancePlatform/platform_api.py @@ -11,12 +11,13 @@ class PlatformApi(AdyenServiceBase): def __init__(self, client=None): super(PlatformApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def get_balance_platform(self, id, idempotency_key=None, **kwargs): """ Get a balance platform """ - endpoint = f"/balancePlatforms/{id}" + endpoint = self.baseUrl + f"/balancePlatforms/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_all_account_holders_under_balance_platform(self, id, idempotency_key=Non """ Get all account holders under a balance platform """ - endpoint = f"/balancePlatforms/{id}/accountHolders" + endpoint = self.baseUrl + f"/balancePlatforms/{id}/accountHolders" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/balancePlatform/transaction_rules_api.py b/Adyen/services/balancePlatform/transaction_rules_api.py index 1c58e252..c7085c78 100644 --- a/Adyen/services/balancePlatform/transaction_rules_api.py +++ b/Adyen/services/balancePlatform/transaction_rules_api.py @@ -11,12 +11,13 @@ class TransactionRulesApi(AdyenServiceBase): def __init__(self, client=None): super(TransactionRulesApi, self).__init__(client=client) self.service = "balancePlatform" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" def delete_transaction_rule(self, transactionRuleId, idempotency_key=None, **kwargs): """ Delete a transaction rule """ - endpoint = f"/transactionRules/{transactionRuleId}" + endpoint = self.baseUrl + f"/transactionRules/{transactionRuleId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_transaction_rule(self, transactionRuleId, idempotency_key=None, **kwargs """ Get a transaction rule """ - endpoint = f"/transactionRules/{transactionRuleId}" + endpoint = self.baseUrl + f"/transactionRules/{transactionRuleId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_transaction_rule(self, request, transactionRuleId, idempotency_key=No """ Update a transaction rule """ - endpoint = f"/transactionRules/{transactionRuleId}" + endpoint = self.baseUrl + f"/transactionRules/{transactionRuleId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_transaction_rule(self, request, idempotency_key=None, **kwargs): """ Create a transaction rule """ - endpoint = f"/transactionRules" + endpoint = self.baseUrl + f"/transactionRules" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/binlookup.py b/Adyen/services/binlookup.py index 20dc7a9e..d8b22ae1 100644 --- a/Adyen/services/binlookup.py +++ b/Adyen/services/binlookup.py @@ -11,12 +11,13 @@ class AdyenBinlookupApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenBinlookupApi, self).__init__(client=client) self.service = "binlookup" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/BinLookup/v52" def get3ds_availability(self, request, idempotency_key=None, **kwargs): """ Check if 3D Secure is available """ - endpoint = f"/get3dsAvailability" + endpoint = self.baseUrl + f"/get3dsAvailability" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_cost_estimate(self, request, idempotency_key=None, **kwargs): """ Get a fees cost estimate """ - endpoint = f"/getCostEstimate" + endpoint = self.baseUrl + f"/getCostEstimate" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/classic_checkout_sdk_api.py b/Adyen/services/checkout/classic_checkout_sdk_api.py index 093c3ce9..9246c3b3 100644 --- a/Adyen/services/checkout/classic_checkout_sdk_api.py +++ b/Adyen/services/checkout/classic_checkout_sdk_api.py @@ -11,12 +11,13 @@ class ClassicCheckoutSDKApi(AdyenServiceBase): def __init__(self, client=None): super(ClassicCheckoutSDKApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def payment_session(self, request, idempotency_key=None, **kwargs): """ Create a payment session """ - endpoint = f"/paymentSession" + endpoint = self.baseUrl + f"/paymentSession" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def verify_payment_result(self, request, idempotency_key=None, **kwargs): """ Verify a payment result """ - endpoint = f"/payments/result" + endpoint = self.baseUrl + f"/payments/result" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/modifications_api.py b/Adyen/services/checkout/modifications_api.py index 2683b375..37212812 100644 --- a/Adyen/services/checkout/modifications_api.py +++ b/Adyen/services/checkout/modifications_api.py @@ -11,12 +11,13 @@ class ModificationsApi(AdyenServiceBase): def __init__(self, client=None): super(ModificationsApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def cancel_authorised_payment(self, request, idempotency_key=None, **kwargs): """ Cancel an authorised payment """ - endpoint = f"/cancels" + endpoint = self.baseUrl + f"/cancels" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def update_authorised_amount(self, request, paymentPspReference, idempotency_key """ Update an authorised amount """ - endpoint = f"/payments/{paymentPspReference}/amountUpdates" + endpoint = self.baseUrl + f"/payments/{paymentPspReference}/amountUpdates" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def cancel_authorised_payment_by_psp_reference(self, request, paymentPspReferenc """ Cancel an authorised payment """ - endpoint = f"/payments/{paymentPspReference}/cancels" + endpoint = self.baseUrl + f"/payments/{paymentPspReference}/cancels" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def capture_authorised_payment(self, request, paymentPspReference, idempotency_k """ Capture an authorised payment """ - endpoint = f"/payments/{paymentPspReference}/captures" + endpoint = self.baseUrl + f"/payments/{paymentPspReference}/captures" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def refund_captured_payment(self, request, paymentPspReference, idempotency_key= """ Refund a captured payment """ - endpoint = f"/payments/{paymentPspReference}/refunds" + endpoint = self.baseUrl + f"/payments/{paymentPspReference}/refunds" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def refund_or_cancel_payment(self, request, paymentPspReference, idempotency_key """ Refund or cancel a payment """ - endpoint = f"/payments/{paymentPspReference}/reversals" + endpoint = self.baseUrl + f"/payments/{paymentPspReference}/reversals" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/orders_api.py b/Adyen/services/checkout/orders_api.py index fadccea8..cc932c56 100644 --- a/Adyen/services/checkout/orders_api.py +++ b/Adyen/services/checkout/orders_api.py @@ -11,12 +11,13 @@ class OrdersApi(AdyenServiceBase): def __init__(self, client=None): super(OrdersApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def orders(self, request, idempotency_key=None, **kwargs): """ Create an order """ - endpoint = f"/orders" + endpoint = self.baseUrl + f"/orders" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def cancel_order(self, request, idempotency_key=None, **kwargs): """ Cancel an order """ - endpoint = f"/orders/cancel" + endpoint = self.baseUrl + f"/orders/cancel" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_balance_of_gift_card(self, request, idempotency_key=None, **kwargs): """ Get the balance of a gift card """ - endpoint = f"/paymentMethods/balance" + endpoint = self.baseUrl + f"/paymentMethods/balance" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/payment_links_api.py b/Adyen/services/checkout/payment_links_api.py index ff39423d..77c0801d 100644 --- a/Adyen/services/checkout/payment_links_api.py +++ b/Adyen/services/checkout/payment_links_api.py @@ -11,12 +11,13 @@ class PaymentLinksApi(AdyenServiceBase): def __init__(self, client=None): super(PaymentLinksApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def get_payment_link(self, linkId, idempotency_key=None, **kwargs): """ Get a payment link """ - endpoint = f"/paymentLinks/{linkId}" + endpoint = self.baseUrl + f"/paymentLinks/{linkId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def update_payment_link(self, request, linkId, idempotency_key=None, **kwargs): """ Update the status of a payment link """ - endpoint = f"/paymentLinks/{linkId}" + endpoint = self.baseUrl + f"/paymentLinks/{linkId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def payment_links(self, request, idempotency_key=None, **kwargs): """ Create a payment link """ - endpoint = f"/paymentLinks" + endpoint = self.baseUrl + f"/paymentLinks" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/payments_api.py b/Adyen/services/checkout/payments_api.py index 9ab8ec0d..69a69f50 100644 --- a/Adyen/services/checkout/payments_api.py +++ b/Adyen/services/checkout/payments_api.py @@ -11,20 +11,13 @@ class PaymentsApi(AdyenServiceBase): def __init__(self, client=None): super(PaymentsApi, self).__init__(client=client) self.service = "checkout" - - def get_synchronous_result_of_payment_session(self, sessionId, idempotency_key=None, **kwargs): - """ - Get a synchronous result of a payment session - """ - endpoint = f"/sessions/{sessionId}" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) + self.baseUrl = "https://checkout-test.adyen.com/v70" def card_details(self, request, idempotency_key=None, **kwargs): """ Get the list of brands on the card """ - endpoint = f"/cardDetails" + endpoint = self.baseUrl + f"/cardDetails" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +25,7 @@ def donations(self, request, idempotency_key=None, **kwargs): """ Start a transaction for donations """ - endpoint = f"/donations" + endpoint = self.baseUrl + f"/donations" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +33,7 @@ def payment_methods(self, request, idempotency_key=None, **kwargs): """ Get a list of available payment methods """ - endpoint = f"/paymentMethods" + endpoint = self.baseUrl + f"/paymentMethods" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +41,7 @@ def payments(self, request, idempotency_key=None, **kwargs): """ Start a transaction """ - endpoint = f"/payments" + endpoint = self.baseUrl + f"/payments" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +49,7 @@ def payments_details(self, request, idempotency_key=None, **kwargs): """ Submit details for a payment """ - endpoint = f"/payments/details" + endpoint = self.baseUrl + f"/payments/details" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +57,7 @@ def sessions(self, request, idempotency_key=None, **kwargs): """ Create a payment session """ - endpoint = f"/sessions" + endpoint = self.baseUrl + f"/sessions" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/recurring_api.py b/Adyen/services/checkout/recurring_api.py index 429a7454..f9d5d0f8 100644 --- a/Adyen/services/checkout/recurring_api.py +++ b/Adyen/services/checkout/recurring_api.py @@ -11,12 +11,13 @@ class RecurringApi(AdyenServiceBase): def __init__(self, client=None): super(RecurringApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def delete_token_for_stored_payment_details(self, recurringId, idempotency_key=None, **kwargs): """ Delete a token for stored payment details """ - endpoint = f"/storedPaymentMethods/{recurringId}" + endpoint = self.baseUrl + f"/storedPaymentMethods/{recurringId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_tokens_for_stored_payment_details(self, idempotency_key=None, **kwargs): """ Get tokens for stored payment details """ - endpoint = f"/storedPaymentMethods" + endpoint = self.baseUrl + f"/storedPaymentMethods" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/checkout/utility_api.py b/Adyen/services/checkout/utility_api.py index fbc74c9f..eb1af7ce 100644 --- a/Adyen/services/checkout/utility_api.py +++ b/Adyen/services/checkout/utility_api.py @@ -11,12 +11,13 @@ class UtilityApi(AdyenServiceBase): def __init__(self, client=None): super(UtilityApi, self).__init__(client=client) self.service = "checkout" + self.baseUrl = "https://checkout-test.adyen.com/v70" def get_apple_pay_session(self, request, idempotency_key=None, **kwargs): """ Get an Apple Pay session """ - endpoint = f"/applePay/sessions" + endpoint = self.baseUrl + f"/applePay/sessions" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def origin_keys(self, request, idempotency_key=None, **kwargs): """ Create originKey values for domains """ - endpoint = f"/originKeys" + endpoint = self.baseUrl + f"/originKeys" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/dataProtection.py b/Adyen/services/dataProtection.py index 2961f0c0..dbda0a10 100644 --- a/Adyen/services/dataProtection.py +++ b/Adyen/services/dataProtection.py @@ -11,12 +11,13 @@ class AdyenDataProtectionApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenDataProtectionApi, self).__init__(client=client) self.service = "dataProtection" + self.baseUrl = "https://ca-test.adyen.com/ca/services/DataProtectionService/v1" def request_subject_erasure(self, request, idempotency_key=None, **kwargs): """ Submit a Subject Erasure Request. """ - endpoint = f"/requestSubjectErasure" + endpoint = self.baseUrl + f"/requestSubjectErasure" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/business_lines_api.py b/Adyen/services/legalEntityManagement/business_lines_api.py index 0a1dab01..9f6a71f5 100644 --- a/Adyen/services/legalEntityManagement/business_lines_api.py +++ b/Adyen/services/legalEntityManagement/business_lines_api.py @@ -11,12 +11,13 @@ class BusinessLinesApi(AdyenServiceBase): def __init__(self, client=None): super(BusinessLinesApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def delete_business_line(self, id, idempotency_key=None, **kwargs): """ Delete a business line """ - endpoint = f"/businessLines/{id}" + endpoint = self.baseUrl + f"/businessLines/{id}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_business_line(self, id, idempotency_key=None, **kwargs): """ Get a business line """ - endpoint = f"/businessLines/{id}" + endpoint = self.baseUrl + f"/businessLines/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_business_line(self, request, id, idempotency_key=None, **kwargs): """ Update a business line """ - endpoint = f"/businessLines/{id}" + endpoint = self.baseUrl + f"/businessLines/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_business_line(self, request, idempotency_key=None, **kwargs): """ Create a business line """ - endpoint = f"/businessLines" + endpoint = self.baseUrl + f"/businessLines" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/documents_api.py b/Adyen/services/legalEntityManagement/documents_api.py index c084b0c0..5c1a343c 100644 --- a/Adyen/services/legalEntityManagement/documents_api.py +++ b/Adyen/services/legalEntityManagement/documents_api.py @@ -11,12 +11,13 @@ class DocumentsApi(AdyenServiceBase): def __init__(self, client=None): super(DocumentsApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def delete_document(self, id, idempotency_key=None, **kwargs): """ Delete a document """ - endpoint = f"/documents/{id}" + endpoint = self.baseUrl + f"/documents/{id}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_document(self, id, idempotency_key=None, **kwargs): """ Get a document """ - endpoint = f"/documents/{id}" + endpoint = self.baseUrl + f"/documents/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_document(self, request, id, idempotency_key=None, **kwargs): """ Update a document """ - endpoint = f"/documents/{id}" + endpoint = self.baseUrl + f"/documents/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def upload_document_for_verification_checks(self, request, idempotency_key=None, """ Upload a document for verification checks """ - endpoint = f"/documents" + endpoint = self.baseUrl + f"/documents" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/hosted_onboarding_api.py b/Adyen/services/legalEntityManagement/hosted_onboarding_api.py index a593d901..66b765ac 100644 --- a/Adyen/services/legalEntityManagement/hosted_onboarding_api.py +++ b/Adyen/services/legalEntityManagement/hosted_onboarding_api.py @@ -11,12 +11,13 @@ class HostedOnboardingApi(AdyenServiceBase): def __init__(self, client=None): super(HostedOnboardingApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def list_hosted_onboarding_page_themes(self, idempotency_key=None, **kwargs): """ Get a list of hosted onboarding page themes """ - endpoint = f"/themes" + endpoint = self.baseUrl + f"/themes" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_onboarding_link_theme(self, id, idempotency_key=None, **kwargs): """ Get an onboarding link theme """ - endpoint = f"/themes/{id}" + endpoint = self.baseUrl + f"/themes/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_link_to_adyenhosted_onboarding_page(self, request, id, idempotency_key=N """ Get a link to an Adyen-hosted onboarding page """ - endpoint = f"/legalEntities/{id}/onboardingLinks" + endpoint = self.baseUrl + f"/legalEntities/{id}/onboardingLinks" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/legal_entities_api.py b/Adyen/services/legalEntityManagement/legal_entities_api.py index 0dfcaaaf..3ea8a246 100644 --- a/Adyen/services/legalEntityManagement/legal_entities_api.py +++ b/Adyen/services/legalEntityManagement/legal_entities_api.py @@ -11,12 +11,13 @@ class LegalEntitiesApi(AdyenServiceBase): def __init__(self, client=None): super(LegalEntitiesApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def get_legal_entity(self, id, idempotency_key=None, **kwargs): """ Get a legal entity """ - endpoint = f"/legalEntities/{id}" + endpoint = self.baseUrl + f"/legalEntities/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_all_business_lines_under_legal_entity(self, id, idempotency_key=None, ** """ Get all business lines under a legal entity """ - endpoint = f"/legalEntities/{id}/businessLines" + endpoint = self.baseUrl + f"/legalEntities/{id}/businessLines" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_legal_entity(self, request, id, idempotency_key=None, **kwargs): """ Update a legal entity """ - endpoint = f"/legalEntities/{id}" + endpoint = self.baseUrl + f"/legalEntities/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_legal_entity(self, request, idempotency_key=None, **kwargs): """ Create a legal entity """ - endpoint = f"/legalEntities" + endpoint = self.baseUrl + f"/legalEntities" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def check_legal_entitys_verification_errors(self, id, idempotency_key=None, **kw """ Check a legal entity's verification errors """ - endpoint = f"/legalEntities/{id}/checkVerificationErrors" + endpoint = self.baseUrl + f"/legalEntities/{id}/checkVerificationErrors" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/pci_questionnaires_api.py b/Adyen/services/legalEntityManagement/pci_questionnaires_api.py index 21627a52..8f7b1133 100644 --- a/Adyen/services/legalEntityManagement/pci_questionnaires_api.py +++ b/Adyen/services/legalEntityManagement/pci_questionnaires_api.py @@ -11,12 +11,13 @@ class PCIQuestionnairesApi(AdyenServiceBase): def __init__(self, client=None): super(PCIQuestionnairesApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def get_pci_questionnaire_details(self, id, idempotency_key=None, **kwargs): """ Get PCI questionnaire details """ - endpoint = f"/legalEntities/{id}/pciQuestionnaires" + endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_pci_questionnaire(self, id, pciid, idempotency_key=None, **kwargs): """ Get PCI questionnaire """ - endpoint = f"/legalEntities/{id}/pciQuestionnaires/{pciid}" + endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/{pciid}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def generate_pci_questionnaire(self, request, id, idempotency_key=None, **kwargs """ Generate PCI questionnaire """ - endpoint = f"/legalEntities/{id}/pciQuestionnaires/generatePciTemplates" + endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/generatePciTemplates" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def sign_pci_questionnaire(self, request, id, idempotency_key=None, **kwargs): """ Sign PCI questionnaire """ - endpoint = f"/legalEntities/{id}/pciQuestionnaires/signPciTemplates" + endpoint = self.baseUrl + f"/legalEntities/{id}/pciQuestionnaires/signPciTemplates" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/terms_of_service_api.py b/Adyen/services/legalEntityManagement/terms_of_service_api.py index ad4cae96..6d140ff9 100644 --- a/Adyen/services/legalEntityManagement/terms_of_service_api.py +++ b/Adyen/services/legalEntityManagement/terms_of_service_api.py @@ -11,20 +11,13 @@ class TermsOfServiceApi(AdyenServiceBase): def __init__(self, client=None): super(TermsOfServiceApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def get_terms_of_service_information_for_legal_entity(self, id, idempotency_key=None, **kwargs): """ Get Terms of Service information for a legal entity """ - endpoint = f"/legalEntities/{id}/termsOfServiceAcceptanceInfos" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def get_terms_of_service_status(self, id, idempotency_key=None, **kwargs): - """ - Get Terms of Service status - """ - endpoint = f"/legalEntities/{id}/termsOfServiceStatus" + endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfServiceAcceptanceInfos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +25,7 @@ def accept_terms_of_service(self, request, id, termsofservicedocumentid, idempot """ Accept Terms of Service """ - endpoint = f"/legalEntities/{id}/termsOfService/{termsofservicedocumentid}" + endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfService/{termsofservicedocumentid}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +33,7 @@ def get_terms_of_service_document(self, request, id, idempotency_key=None, **kwa """ Get Terms of Service document """ - endpoint = f"/legalEntities/{id}/termsOfService" + endpoint = self.baseUrl + f"/legalEntities/{id}/termsOfService" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/legalEntityManagement/transfer_instruments_api.py b/Adyen/services/legalEntityManagement/transfer_instruments_api.py index 71d02e2d..96e1781d 100644 --- a/Adyen/services/legalEntityManagement/transfer_instruments_api.py +++ b/Adyen/services/legalEntityManagement/transfer_instruments_api.py @@ -11,12 +11,13 @@ class TransferInstrumentsApi(AdyenServiceBase): def __init__(self, client=None): super(TransferInstrumentsApi, self).__init__(client=client) self.service = "legalEntityManagement" + self.baseUrl = "https://kyc-test.adyen.com/lem/v3" def delete_transfer_instrument(self, id, idempotency_key=None, **kwargs): """ Delete a transfer instrument """ - endpoint = f"/transferInstruments/{id}" + endpoint = self.baseUrl + f"/transferInstruments/{id}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_transfer_instrument(self, id, idempotency_key=None, **kwargs): """ Get a transfer instrument """ - endpoint = f"/transferInstruments/{id}" + endpoint = self.baseUrl + f"/transferInstruments/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_transfer_instrument(self, request, id, idempotency_key=None, **kwargs """ Update a transfer instrument """ - endpoint = f"/transferInstruments/{id}" + endpoint = self.baseUrl + f"/transferInstruments/{id}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_transfer_instrument(self, request, idempotency_key=None, **kwargs): """ Create a transfer instrument """ - endpoint = f"/transferInstruments" + endpoint = self.baseUrl + f"/transferInstruments" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/__init__.py b/Adyen/services/management/__init__.py index 362eff8f..27b2a1e4 100644 --- a/Adyen/services/management/__init__.py +++ b/Adyen/services/management/__init__.py @@ -13,7 +13,6 @@ from .my_api_credential_api import MyAPICredentialApi from .payment_methods_merchant_level_api import PaymentMethodsMerchantLevelApi from .payout_settings_merchant_level_api import PayoutSettingsMerchantLevelApi -from .split_configuration_merchant_level_api import SplitConfigurationMerchantLevelApi from .terminal_actions_company_level_api import TerminalActionsCompanyLevelApi from .terminal_actions_terminal_level_api import TerminalActionsTerminalLevelApi from .terminal_orders_company_level_api import TerminalOrdersCompanyLevelApi @@ -52,7 +51,6 @@ def __init__(self, client=None): self.my_api_credential_api = MyAPICredentialApi(client=client) self.payment_methods_merchant_level_api = PaymentMethodsMerchantLevelApi(client=client) self.payout_settings_merchant_level_api = PayoutSettingsMerchantLevelApi(client=client) - self.split_configuration_merchant_level_api = SplitConfigurationMerchantLevelApi(client=client) self.terminal_actions_company_level_api = TerminalActionsCompanyLevelApi(client=client) self.terminal_actions_terminal_level_api = TerminalActionsTerminalLevelApi(client=client) self.terminal_orders_company_level_api = TerminalOrdersCompanyLevelApi(client=client) diff --git a/Adyen/services/management/account_company_level_api.py b/Adyen/services/management/account_company_level_api.py index 5bfbb4e0..290cebe5 100644 --- a/Adyen/services/management/account_company_level_api.py +++ b/Adyen/services/management/account_company_level_api.py @@ -11,12 +11,13 @@ class AccountCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(AccountCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_company_accounts(self, idempotency_key=None, **kwargs): """ Get a list of company accounts """ - endpoint = f"/companies" + endpoint = self.baseUrl + f"/companies" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_company_account(self, companyId, idempotency_key=None, **kwargs): """ Get a company account """ - endpoint = f"/companies/{companyId}" + endpoint = self.baseUrl + f"/companies/{companyId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def list_merchant_accounts(self, companyId, idempotency_key=None, **kwargs): """ Get a list of merchant accounts """ - endpoint = f"/companies/{companyId}/merchants" + endpoint = self.baseUrl + f"/companies/{companyId}/merchants" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/account_merchant_level_api.py b/Adyen/services/management/account_merchant_level_api.py index c5a57d8a..e032cb8d 100644 --- a/Adyen/services/management/account_merchant_level_api.py +++ b/Adyen/services/management/account_merchant_level_api.py @@ -11,12 +11,13 @@ class AccountMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(AccountMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_merchant_accounts(self, idempotency_key=None, **kwargs): """ Get a list of merchant accounts """ - endpoint = f"/merchants" + endpoint = self.baseUrl + f"/merchants" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_merchant_account(self, merchantId, idempotency_key=None, **kwargs): """ Get a merchant account """ - endpoint = f"/merchants/{merchantId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def create_merchant_account(self, request, idempotency_key=None, **kwargs): """ Create a merchant account """ - endpoint = f"/merchants" + endpoint = self.baseUrl + f"/merchants" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def request_to_activate_merchant_account(self, merchantId, idempotency_key=None, """ Request to activate a merchant account """ - endpoint = f"/merchants/{merchantId}/activate" + endpoint = self.baseUrl + f"/merchants/{merchantId}/activate" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/account_store_level_api.py b/Adyen/services/management/account_store_level_api.py index f827b87e..09ff8927 100644 --- a/Adyen/services/management/account_store_level_api.py +++ b/Adyen/services/management/account_store_level_api.py @@ -11,12 +11,13 @@ class AccountStoreLevelApi(AdyenServiceBase): def __init__(self, client=None): super(AccountStoreLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_stores_by_merchant_id(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of stores """ - endpoint = f"/merchants/{merchantId}/stores" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_store(self, merchantId, storeId, idempotency_key=None, **kwargs): """ Get a store """ - endpoint = f"/merchants/{merchantId}/stores/{storeId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def list_stores(self, idempotency_key=None, **kwargs): """ Get a list of stores """ - endpoint = f"/stores" + endpoint = self.baseUrl + f"/stores" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_store_by_id(self, storeId, idempotency_key=None, **kwargs): """ Get a store """ - endpoint = f"/stores/{storeId}" + endpoint = self.baseUrl + f"/stores/{storeId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def update_store(self, request, merchantId, storeId, idempotency_key=None, **kwa """ Update a store """ - endpoint = f"/merchants/{merchantId}/stores/{storeId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def update_store_by_id(self, request, storeId, idempotency_key=None, **kwargs): """ Update a store """ - endpoint = f"/stores/{storeId}" + endpoint = self.baseUrl + f"/stores/{storeId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def create_store_by_merchant_id(self, request, merchantId, idempotency_key=None, """ Create a store """ - endpoint = f"/merchants/{merchantId}/stores" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def create_store(self, request, idempotency_key=None, **kwargs): """ Create a store """ - endpoint = f"/stores" + endpoint = self.baseUrl + f"/stores" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/allowed_origins_company_level_api.py b/Adyen/services/management/allowed_origins_company_level_api.py index cac7805c..bc634c0e 100644 --- a/Adyen/services/management/allowed_origins_company_level_api.py +++ b/Adyen/services/management/allowed_origins_company_level_api.py @@ -11,12 +11,13 @@ class AllowedOriginsCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(AllowedOriginsCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def delete_allowed_origin(self, companyId, apiCredentialId, originId, idempotency_key=None, **kwargs): """ Delete an allowed origin """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_allowed_origins(self, companyId, apiCredentialId, idempotency_key=None, """ Get a list of allowed origins """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_allowed_origin(self, companyId, apiCredentialId, originId, idempotency_k """ Get an allowed origin """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_allowed_origin(self, request, companyId, apiCredentialId, idempotency """ Create an allowed origin """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/allowed_origins_merchant_level_api.py b/Adyen/services/management/allowed_origins_merchant_level_api.py index cbb957bc..147dd079 100644 --- a/Adyen/services/management/allowed_origins_merchant_level_api.py +++ b/Adyen/services/management/allowed_origins_merchant_level_api.py @@ -11,12 +11,13 @@ class AllowedOriginsMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(AllowedOriginsMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def delete_allowed_origin(self, merchantId, apiCredentialId, originId, idempotency_key=None, **kwargs): """ Delete an allowed origin """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_allowed_origins(self, merchantId, apiCredentialId, idempotency_key=None """ Get a list of allowed origins """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_allowed_origin(self, merchantId, apiCredentialId, originId, idempotency_ """ Get an allowed origin """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_allowed_origin(self, request, merchantId, apiCredentialId, idempotenc """ Create an allowed origin """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/api_credentials_company_level_api.py b/Adyen/services/management/api_credentials_company_level_api.py index 82f5342d..1dab84fb 100644 --- a/Adyen/services/management/api_credentials_company_level_api.py +++ b/Adyen/services/management/api_credentials_company_level_api.py @@ -11,12 +11,13 @@ class APICredentialsCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(APICredentialsCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_api_credentials(self, companyId, idempotency_key=None, **kwargs): """ Get a list of API credentials """ - endpoint = f"/companies/{companyId}/apiCredentials" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_api_credential(self, companyId, apiCredentialId, idempotency_key=None, * """ Get an API credential """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_api_credential(self, request, companyId, apiCredentialId, idempotency """ Update an API credential. """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_api_credential(self, request, companyId, idempotency_key=None, **kwar """ Create an API credential. """ - endpoint = f"/companies/{companyId}/apiCredentials" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/api_credentials_merchant_level_api.py b/Adyen/services/management/api_credentials_merchant_level_api.py index 0d7d4207..513d6e36 100644 --- a/Adyen/services/management/api_credentials_merchant_level_api.py +++ b/Adyen/services/management/api_credentials_merchant_level_api.py @@ -11,12 +11,13 @@ class APICredentialsMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(APICredentialsMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_api_credentials(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of API credentials """ - endpoint = f"/merchants/{merchantId}/apiCredentials" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_api_credential(self, merchantId, apiCredentialId, idempotency_key=None, """ Get an API credential """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_api_credential(self, request, merchantId, apiCredentialId, idempotenc """ Update an API credential """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_api_credential(self, request, merchantId, idempotency_key=None, **kwa """ Create an API credential """ - endpoint = f"/merchants/{merchantId}/apiCredentials" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/api_key_company_level_api.py b/Adyen/services/management/api_key_company_level_api.py index 14ecb926..edf17819 100644 --- a/Adyen/services/management/api_key_company_level_api.py +++ b/Adyen/services/management/api_key_company_level_api.py @@ -11,12 +11,13 @@ class APIKeyCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(APIKeyCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def generate_new_api_key(self, companyId, apiCredentialId, idempotency_key=None, **kwargs): """ Generate new API key """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/api_key_merchant_level_api.py b/Adyen/services/management/api_key_merchant_level_api.py index 55e46b8a..2fc9c71a 100644 --- a/Adyen/services/management/api_key_merchant_level_api.py +++ b/Adyen/services/management/api_key_merchant_level_api.py @@ -11,12 +11,13 @@ class APIKeyMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(APIKeyMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def generate_new_api_key(self, merchantId, apiCredentialId, idempotency_key=None, **kwargs): """ Generate new API key """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/client_key_company_level_api.py b/Adyen/services/management/client_key_company_level_api.py index f8a7f7d7..9abb769a 100644 --- a/Adyen/services/management/client_key_company_level_api.py +++ b/Adyen/services/management/client_key_company_level_api.py @@ -11,12 +11,13 @@ class ClientKeyCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(ClientKeyCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def generate_new_client_key(self, companyId, apiCredentialId, idempotency_key=None, **kwargs): """ Generate new client key """ - endpoint = f"/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey" + endpoint = self.baseUrl + f"/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/client_key_merchant_level_api.py b/Adyen/services/management/client_key_merchant_level_api.py index effa8fd8..78365fc5 100644 --- a/Adyen/services/management/client_key_merchant_level_api.py +++ b/Adyen/services/management/client_key_merchant_level_api.py @@ -11,12 +11,13 @@ class ClientKeyMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(ClientKeyMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def generate_new_client_key(self, merchantId, apiCredentialId, idempotency_key=None, **kwargs): """ Generate new client key """ - endpoint = f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey" + endpoint = self.baseUrl + f"/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/my_api_credential_api.py b/Adyen/services/management/my_api_credential_api.py index 93056bb7..1f44af96 100644 --- a/Adyen/services/management/my_api_credential_api.py +++ b/Adyen/services/management/my_api_credential_api.py @@ -11,12 +11,13 @@ class MyAPICredentialApi(AdyenServiceBase): def __init__(self, client=None): super(MyAPICredentialApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def remove_allowed_origin(self, originId, idempotency_key=None, **kwargs): """ Remove allowed origin """ - endpoint = f"/me/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/me/allowedOrigins/{originId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_api_credential_details(self, idempotency_key=None, **kwargs): """ Get API credential details """ - endpoint = f"/me" + endpoint = self.baseUrl + f"/me" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_allowed_origins(self, idempotency_key=None, **kwargs): """ Get allowed origins """ - endpoint = f"/me/allowedOrigins" + endpoint = self.baseUrl + f"/me/allowedOrigins" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_allowed_origin_details(self, originId, idempotency_key=None, **kwargs): """ Get allowed origin details """ - endpoint = f"/me/allowedOrigins/{originId}" + endpoint = self.baseUrl + f"/me/allowedOrigins/{originId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def add_allowed_origin(self, request, idempotency_key=None, **kwargs): """ Add allowed origin """ - endpoint = f"/me/allowedOrigins" + endpoint = self.baseUrl + f"/me/allowedOrigins" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/payment_methods_merchant_level_api.py b/Adyen/services/management/payment_methods_merchant_level_api.py index 133dd798..b942ed25 100644 --- a/Adyen/services/management/payment_methods_merchant_level_api.py +++ b/Adyen/services/management/payment_methods_merchant_level_api.py @@ -11,12 +11,13 @@ class PaymentMethodsMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(PaymentMethodsMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def get_all_payment_methods(self, merchantId, idempotency_key=None, **kwargs): """ Get all payment methods """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_payment_method_details(self, merchantId, paymentMethodId, idempotency_ke """ Get payment method details """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_apple_pay_domains(self, merchantId, paymentMethodId, idempotency_key=Non """ Get Apple Pay domains """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_payment_method(self, request, merchantId, paymentMethodId, idempotenc """ Update a payment method """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def request_payment_method(self, request, merchantId, idempotency_key=None, **kw """ Request a payment method """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def add_apple_pay_domain(self, request, merchantId, paymentMethodId, idempotency """ Add an Apple Pay domain """ - endpoint = f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains" + endpoint = self.baseUrl + f"/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/payout_settings_merchant_level_api.py b/Adyen/services/management/payout_settings_merchant_level_api.py index d0fe8e30..18cfd719 100644 --- a/Adyen/services/management/payout_settings_merchant_level_api.py +++ b/Adyen/services/management/payout_settings_merchant_level_api.py @@ -11,12 +11,13 @@ class PayoutSettingsMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(PayoutSettingsMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def delete_payout_setting(self, merchantId, payoutSettingsId, idempotency_key=None, **kwargs): """ Delete a payout setting """ - endpoint = f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_payout_settings(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of payout settings """ - endpoint = f"/merchants/{merchantId}/payoutSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/payoutSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_payout_setting(self, merchantId, payoutSettingsId, idempotency_key=None, """ Get a payout setting """ - endpoint = f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_payout_setting(self, request, merchantId, payoutSettingsId, idempoten """ Update a payout setting """ - endpoint = f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/payoutSettings/{payoutSettingsId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def add_payout_setting(self, request, merchantId, idempotency_key=None, **kwargs """ Add a payout setting """ - endpoint = f"/merchants/{merchantId}/payoutSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/payoutSettings" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/split_configuration_merchant_level_api.py b/Adyen/services/management/split_configuration_merchant_level_api.py deleted file mode 100644 index 67c37c86..00000000 --- a/Adyen/services/management/split_configuration_merchant_level_api.py +++ /dev/null @@ -1,86 +0,0 @@ -from ..base import AdyenServiceBase - - -class SplitConfigurationMerchantLevelApi(AdyenServiceBase): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, client=None): - super(SplitConfigurationMerchantLevelApi, self).__init__(client=client) - self.service = "management" - - def delete_split_configuration(self, merchantId, splitConfigurationId, idempotency_key=None, **kwargs): - """ - Delete a split configuration - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - method = "DELETE" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def delete_split_configuration_rule(self, merchantId, splitConfigurationId, ruleId, idempotency_key=None, **kwargs): - """ - Delete a split configuration rule - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}" - method = "DELETE" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def list_split_configurations(self, merchantId, idempotency_key=None, **kwargs): - """ - Get a list of split configurations - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def get_split_configuration(self, merchantId, splitConfigurationId, idempotency_key=None, **kwargs): - """ - Get a split configuration - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def update_split_configuration_description(self, request, merchantId, splitConfigurationId, idempotency_key=None, **kwargs): - """ - Update split configuration description - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - method = "PATCH" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - - def update_split_conditions(self, request, merchantId, splitConfigurationId, ruleId, idempotency_key=None, **kwargs): - """ - Update split conditions - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}" - method = "PATCH" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - - def update_split_logic(self, request, merchantId, splitConfigurationId, ruleId, splitLogicId, idempotency_key=None, **kwargs): - """ - Update the split logic - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}/rules/{ruleId}/splitLogic/{splitLogicId}" - method = "PATCH" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - - def create_split_configuration(self, request, merchantId, idempotency_key=None, **kwargs): - """ - Create a split configuration - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations" - method = "POST" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - - def create_rule(self, request, merchantId, splitConfigurationId, idempotency_key=None, **kwargs): - """ - Create a rule - """ - endpoint = f"/merchants/{merchantId}/splitConfigurations/{splitConfigurationId}" - method = "POST" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - diff --git a/Adyen/services/management/terminal_actions_company_level_api.py b/Adyen/services/management/terminal_actions_company_level_api.py index ff9144e6..a27f485e 100644 --- a/Adyen/services/management/terminal_actions_company_level_api.py +++ b/Adyen/services/management/terminal_actions_company_level_api.py @@ -11,12 +11,13 @@ class TerminalActionsCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalActionsCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_android_apps(self, companyId, idempotency_key=None, **kwargs): """ Get a list of Android apps """ - endpoint = f"/companies/{companyId}/androidApps" + endpoint = self.baseUrl + f"/companies/{companyId}/androidApps" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_android_certificates(self, companyId, idempotency_key=None, **kwargs): """ Get a list of Android certificates """ - endpoint = f"/companies/{companyId}/androidCertificates" + endpoint = self.baseUrl + f"/companies/{companyId}/androidCertificates" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def list_terminal_actions(self, companyId, idempotency_key=None, **kwargs): """ Get a list of terminal actions """ - endpoint = f"/companies/{companyId}/terminalActions" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalActions" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_terminal_action(self, companyId, actionId, idempotency_key=None, **kwarg """ Get terminal action """ - endpoint = f"/companies/{companyId}/terminalActions/{actionId}" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalActions/{actionId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_actions_terminal_level_api.py b/Adyen/services/management/terminal_actions_terminal_level_api.py index 0f1d6b3b..3a96ceec 100644 --- a/Adyen/services/management/terminal_actions_terminal_level_api.py +++ b/Adyen/services/management/terminal_actions_terminal_level_api.py @@ -11,12 +11,13 @@ class TerminalActionsTerminalLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalActionsTerminalLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def create_terminal_action(self, request, idempotency_key=None, **kwargs): """ Create a terminal action """ - endpoint = f"/terminals/scheduleActions" + endpoint = self.baseUrl + f"/terminals/scheduleActions" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_orders_company_level_api.py b/Adyen/services/management/terminal_orders_company_level_api.py index 362b9fe9..ceecdb6a 100644 --- a/Adyen/services/management/terminal_orders_company_level_api.py +++ b/Adyen/services/management/terminal_orders_company_level_api.py @@ -11,12 +11,13 @@ class TerminalOrdersCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalOrdersCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_billing_entities(self, companyId, idempotency_key=None, **kwargs): """ Get a list of billing entities """ - endpoint = f"/companies/{companyId}/billingEntities" + endpoint = self.baseUrl + f"/companies/{companyId}/billingEntities" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_shipping_locations(self, companyId, idempotency_key=None, **kwargs): """ Get a list of shipping locations """ - endpoint = f"/companies/{companyId}/shippingLocations" + endpoint = self.baseUrl + f"/companies/{companyId}/shippingLocations" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def list_terminal_models(self, companyId, idempotency_key=None, **kwargs): """ Get a list of terminal models """ - endpoint = f"/companies/{companyId}/terminalModels" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalModels" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def list_orders(self, companyId, idempotency_key=None, **kwargs): """ Get a list of orders """ - endpoint = f"/companies/{companyId}/terminalOrders" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def get_order(self, companyId, orderId, idempotency_key=None, **kwargs): """ Get an order """ - endpoint = f"/companies/{companyId}/terminalOrders/{orderId}" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def list_terminal_products(self, companyId, idempotency_key=None, **kwargs): """ Get a list of terminal products """ - endpoint = f"/companies/{companyId}/terminalProducts" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalProducts" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def update_order(self, request, companyId, orderId, idempotency_key=None, **kwar """ Update an order """ - endpoint = f"/companies/{companyId}/terminalOrders/{orderId}" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def create_shipping_location(self, request, companyId, idempotency_key=None, **k """ Create a shipping location """ - endpoint = f"/companies/{companyId}/shippingLocations" + endpoint = self.baseUrl + f"/companies/{companyId}/shippingLocations" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -80,7 +81,7 @@ def create_order(self, request, companyId, idempotency_key=None, **kwargs): """ Create an order """ - endpoint = f"/companies/{companyId}/terminalOrders" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -88,7 +89,7 @@ def cancel_order(self, companyId, orderId, idempotency_key=None, **kwargs): """ Cancel an order """ - endpoint = f"/companies/{companyId}/terminalOrders/{orderId}/cancel" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalOrders/{orderId}/cancel" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_orders_merchant_level_api.py b/Adyen/services/management/terminal_orders_merchant_level_api.py index 4cbbeebf..463854e9 100644 --- a/Adyen/services/management/terminal_orders_merchant_level_api.py +++ b/Adyen/services/management/terminal_orders_merchant_level_api.py @@ -11,12 +11,13 @@ class TerminalOrdersMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalOrdersMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_billing_entities(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of billing entities """ - endpoint = f"/merchants/{merchantId}/billingEntities" + endpoint = self.baseUrl + f"/merchants/{merchantId}/billingEntities" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_shipping_locations(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of shipping locations """ - endpoint = f"/merchants/{merchantId}/shippingLocations" + endpoint = self.baseUrl + f"/merchants/{merchantId}/shippingLocations" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def list_terminal_models(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of terminal models """ - endpoint = f"/merchants/{merchantId}/terminalModels" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalModels" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def list_orders(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of orders """ - endpoint = f"/merchants/{merchantId}/terminalOrders" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalOrders" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def get_order(self, merchantId, orderId, idempotency_key=None, **kwargs): """ Get an order """ - endpoint = f"/merchants/{merchantId}/terminalOrders/{orderId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalOrders/{orderId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def list_terminal_products(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of terminal products """ - endpoint = f"/merchants/{merchantId}/terminalProducts" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalProducts" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def update_order(self, request, merchantId, orderId, idempotency_key=None, **kwa """ Update an order """ - endpoint = f"/merchants/{merchantId}/terminalOrders/{orderId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalOrders/{orderId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def create_shipping_location(self, request, merchantId, idempotency_key=None, ** """ Create a shipping location """ - endpoint = f"/merchants/{merchantId}/shippingLocations" + endpoint = self.baseUrl + f"/merchants/{merchantId}/shippingLocations" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -80,7 +81,7 @@ def create_order(self, request, merchantId, idempotency_key=None, **kwargs): """ Create an order """ - endpoint = f"/merchants/{merchantId}/terminalOrders" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalOrders" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -88,7 +89,7 @@ def cancel_order(self, merchantId, orderId, idempotency_key=None, **kwargs): """ Cancel an order """ - endpoint = f"/merchants/{merchantId}/terminalOrders/{orderId}/cancel" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalOrders/{orderId}/cancel" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_settings_company_level_api.py b/Adyen/services/management/terminal_settings_company_level_api.py index 73dbacab..26c484c9 100644 --- a/Adyen/services/management/terminal_settings_company_level_api.py +++ b/Adyen/services/management/terminal_settings_company_level_api.py @@ -11,12 +11,13 @@ class TerminalSettingsCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalSettingsCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def get_terminal_logo(self, companyId, idempotency_key=None, **kwargs): """ Get the terminal logo """ - endpoint = f"/companies/{companyId}/terminalLogos" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalLogos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_terminal_settings(self, companyId, idempotency_key=None, **kwargs): """ Get terminal settings """ - endpoint = f"/companies/{companyId}/terminalSettings" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_terminal_logo(self, request, companyId, idempotency_key=None, **kwarg """ Update the terminal logo """ - endpoint = f"/companies/{companyId}/terminalLogos" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalLogos" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_terminal_settings(self, request, companyId, idempotency_key=None, **k """ Update terminal settings """ - endpoint = f"/companies/{companyId}/terminalSettings" + endpoint = self.baseUrl + f"/companies/{companyId}/terminalSettings" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_settings_merchant_level_api.py b/Adyen/services/management/terminal_settings_merchant_level_api.py index 3f955eaa..5ba9e227 100644 --- a/Adyen/services/management/terminal_settings_merchant_level_api.py +++ b/Adyen/services/management/terminal_settings_merchant_level_api.py @@ -11,12 +11,13 @@ class TerminalSettingsMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalSettingsMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def get_terminal_logo(self, merchantId, idempotency_key=None, **kwargs): """ Get the terminal logo """ - endpoint = f"/merchants/{merchantId}/terminalLogos" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalLogos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_terminal_settings(self, merchantId, idempotency_key=None, **kwargs): """ Get terminal settings """ - endpoint = f"/merchants/{merchantId}/terminalSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_terminal_logo(self, request, merchantId, idempotency_key=None, **kwar """ Update the terminal logo """ - endpoint = f"/merchants/{merchantId}/terminalLogos" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalLogos" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_terminal_settings(self, request, merchantId, idempotency_key=None, ** """ Update terminal settings """ - endpoint = f"/merchants/{merchantId}/terminalSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/terminalSettings" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_settings_store_level_api.py b/Adyen/services/management/terminal_settings_store_level_api.py index 89634aa3..a80fd92e 100644 --- a/Adyen/services/management/terminal_settings_store_level_api.py +++ b/Adyen/services/management/terminal_settings_store_level_api.py @@ -11,12 +11,13 @@ class TerminalSettingsStoreLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalSettingsStoreLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def get_terminal_logo(self, merchantId, reference, idempotency_key=None, **kwargs): """ Get the terminal logo """ - endpoint = f"/merchants/{merchantId}/stores/{reference}/terminalLogos" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{reference}/terminalLogos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_terminal_settings(self, merchantId, reference, idempotency_key=None, **k """ Get terminal settings """ - endpoint = f"/merchants/{merchantId}/stores/{reference}/terminalSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{reference}/terminalSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_terminal_logo_by_store_id(self, storeId, idempotency_key=None, **kwargs) """ Get the terminal logo """ - endpoint = f"/stores/{storeId}/terminalLogos" + endpoint = self.baseUrl + f"/stores/{storeId}/terminalLogos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_terminal_settings_by_store_id(self, storeId, idempotency_key=None, **kwa """ Get terminal settings """ - endpoint = f"/stores/{storeId}/terminalSettings" + endpoint = self.baseUrl + f"/stores/{storeId}/terminalSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def update_terminal_logo(self, request, merchantId, reference, idempotency_key=N """ Update the terminal logo """ - endpoint = f"/merchants/{merchantId}/stores/{reference}/terminalLogos" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{reference}/terminalLogos" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def update_terminal_settings(self, request, merchantId, reference, idempotency_k """ Update terminal settings """ - endpoint = f"/merchants/{merchantId}/stores/{reference}/terminalSettings" + endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{reference}/terminalSettings" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def update_terminal_logo_by_store_id(self, request, storeId, idempotency_key=Non """ Update the terminal logo """ - endpoint = f"/stores/{storeId}/terminalLogos" + endpoint = self.baseUrl + f"/stores/{storeId}/terminalLogos" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def update_terminal_settings_by_store_id(self, request, storeId, idempotency_key """ Update terminal settings """ - endpoint = f"/stores/{storeId}/terminalSettings" + endpoint = self.baseUrl + f"/stores/{storeId}/terminalSettings" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminal_settings_terminal_level_api.py b/Adyen/services/management/terminal_settings_terminal_level_api.py index 34b7fae3..20f0c96b 100644 --- a/Adyen/services/management/terminal_settings_terminal_level_api.py +++ b/Adyen/services/management/terminal_settings_terminal_level_api.py @@ -11,12 +11,13 @@ class TerminalSettingsTerminalLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalSettingsTerminalLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def get_terminal_logo(self, terminalId, idempotency_key=None, **kwargs): """ Get the terminal logo """ - endpoint = f"/terminals/{terminalId}/terminalLogos" + endpoint = self.baseUrl + f"/terminals/{terminalId}/terminalLogos" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_terminal_settings(self, terminalId, idempotency_key=None, **kwargs): """ Get terminal settings """ - endpoint = f"/terminals/{terminalId}/terminalSettings" + endpoint = self.baseUrl + f"/terminals/{terminalId}/terminalSettings" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_logo(self, request, terminalId, idempotency_key=None, **kwargs): """ Update the logo """ - endpoint = f"/terminals/{terminalId}/terminalLogos" + endpoint = self.baseUrl + f"/terminals/{terminalId}/terminalLogos" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_terminal_settings(self, request, terminalId, idempotency_key=None, ** """ Update terminal settings """ - endpoint = f"/terminals/{terminalId}/terminalSettings" + endpoint = self.baseUrl + f"/terminals/{terminalId}/terminalSettings" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/terminals_terminal_level_api.py b/Adyen/services/management/terminals_terminal_level_api.py index eddb5fca..54120ed2 100644 --- a/Adyen/services/management/terminals_terminal_level_api.py +++ b/Adyen/services/management/terminals_terminal_level_api.py @@ -11,12 +11,13 @@ class TerminalsTerminalLevelApi(AdyenServiceBase): def __init__(self, client=None): super(TerminalsTerminalLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_terminals(self, idempotency_key=None, **kwargs): """ Get a list of terminals """ - endpoint = f"/terminals" + endpoint = self.baseUrl + f"/terminals" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/users_company_level_api.py b/Adyen/services/management/users_company_level_api.py index 9bfb985e..a7e66ab3 100644 --- a/Adyen/services/management/users_company_level_api.py +++ b/Adyen/services/management/users_company_level_api.py @@ -11,12 +11,13 @@ class UsersCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(UsersCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_users(self, companyId, idempotency_key=None, **kwargs): """ Get a list of users """ - endpoint = f"/companies/{companyId}/users" + endpoint = self.baseUrl + f"/companies/{companyId}/users" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_user_details(self, companyId, userId, idempotency_key=None, **kwargs): """ Get user details """ - endpoint = f"/companies/{companyId}/users/{userId}" + endpoint = self.baseUrl + f"/companies/{companyId}/users/{userId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_user_details(self, request, companyId, userId, idempotency_key=None, """ Update user details """ - endpoint = f"/companies/{companyId}/users/{userId}" + endpoint = self.baseUrl + f"/companies/{companyId}/users/{userId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_new_user(self, request, companyId, idempotency_key=None, **kwargs): """ Create a new user """ - endpoint = f"/companies/{companyId}/users" + endpoint = self.baseUrl + f"/companies/{companyId}/users" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/users_merchant_level_api.py b/Adyen/services/management/users_merchant_level_api.py index a41a2362..70edd9cb 100644 --- a/Adyen/services/management/users_merchant_level_api.py +++ b/Adyen/services/management/users_merchant_level_api.py @@ -11,12 +11,13 @@ class UsersMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(UsersMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def list_users(self, merchantId, idempotency_key=None, **kwargs): """ Get a list of users """ - endpoint = f"/merchants/{merchantId}/users" + endpoint = self.baseUrl + f"/merchants/{merchantId}/users" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_user_details(self, merchantId, userId, idempotency_key=None, **kwargs): """ Get user details """ - endpoint = f"/merchants/{merchantId}/users/{userId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/users/{userId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def update_user(self, request, merchantId, userId, idempotency_key=None, **kwarg """ Update a user """ - endpoint = f"/merchants/{merchantId}/users/{userId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/users/{userId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def create_new_user(self, request, merchantId, idempotency_key=None, **kwargs): """ Create a new user """ - endpoint = f"/merchants/{merchantId}/users" + endpoint = self.baseUrl + f"/merchants/{merchantId}/users" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/webhooks_company_level_api.py b/Adyen/services/management/webhooks_company_level_api.py index 4fd4ede4..6cccdc27 100644 --- a/Adyen/services/management/webhooks_company_level_api.py +++ b/Adyen/services/management/webhooks_company_level_api.py @@ -11,12 +11,13 @@ class WebhooksCompanyLevelApi(AdyenServiceBase): def __init__(self, client=None): super(WebhooksCompanyLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def remove_webhook(self, companyId, webhookId, idempotency_key=None, **kwargs): """ Remove a webhook """ - endpoint = f"/companies/{companyId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks/{webhookId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_all_webhooks(self, companyId, idempotency_key=None, **kwargs): """ List all webhooks """ - endpoint = f"/companies/{companyId}/webhooks" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_webhook(self, companyId, webhookId, idempotency_key=None, **kwargs): """ Get a webhook """ - endpoint = f"/companies/{companyId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks/{webhookId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_webhook(self, request, companyId, webhookId, idempotency_key=None, ** """ Update a webhook """ - endpoint = f"/companies/{companyId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks/{webhookId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def set_up_webhook(self, request, companyId, idempotency_key=None, **kwargs): """ Set up a webhook """ - endpoint = f"/companies/{companyId}/webhooks" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def generate_hmac_key(self, companyId, webhookId, idempotency_key=None, **kwargs """ Generate an HMAC key """ - endpoint = f"/companies/{companyId}/webhooks/{webhookId}/generateHmac" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks/{webhookId}/generateHmac" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def test_webhook(self, request, companyId, webhookId, idempotency_key=None, **kw """ Test a webhook """ - endpoint = f"/companies/{companyId}/webhooks/{webhookId}/test" + endpoint = self.baseUrl + f"/companies/{companyId}/webhooks/{webhookId}/test" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/management/webhooks_merchant_level_api.py b/Adyen/services/management/webhooks_merchant_level_api.py index 30759177..8d61589b 100644 --- a/Adyen/services/management/webhooks_merchant_level_api.py +++ b/Adyen/services/management/webhooks_merchant_level_api.py @@ -11,12 +11,13 @@ class WebhooksMerchantLevelApi(AdyenServiceBase): def __init__(self, client=None): super(WebhooksMerchantLevelApi, self).__init__(client=client) self.service = "management" + self.baseUrl = "https://management-test.adyen.com/v1" def remove_webhook(self, merchantId, webhookId, idempotency_key=None, **kwargs): """ Remove a webhook """ - endpoint = f"/merchants/{merchantId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks/{webhookId}" method = "DELETE" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def list_all_webhooks(self, merchantId, idempotency_key=None, **kwargs): """ List all webhooks """ - endpoint = f"/merchants/{merchantId}/webhooks" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_webhook(self, merchantId, webhookId, idempotency_key=None, **kwargs): """ Get a webhook """ - endpoint = f"/merchants/{merchantId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks/{webhookId}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def update_webhook(self, request, merchantId, webhookId, idempotency_key=None, * """ Update a webhook """ - endpoint = f"/merchants/{merchantId}/webhooks/{webhookId}" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks/{webhookId}" method = "PATCH" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def set_up_webhook(self, request, merchantId, idempotency_key=None, **kwargs): """ Set up a webhook """ - endpoint = f"/merchants/{merchantId}/webhooks" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def generate_hmac_key(self, merchantId, webhookId, idempotency_key=None, **kwarg """ Generate an HMAC key """ - endpoint = f"/merchants/{merchantId}/webhooks/{webhookId}/generateHmac" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks/{webhookId}/generateHmac" method = "POST" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def test_webhook(self, request, merchantId, webhookId, idempotency_key=None, **k """ Test a webhook """ - endpoint = f"/merchants/{merchantId}/webhooks/{webhookId}/test" + endpoint = self.baseUrl + f"/merchants/{merchantId}/webhooks/{webhookId}/test" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/payments/general_api.py b/Adyen/services/payments/general_api.py index b84ff302..0e649805 100644 --- a/Adyen/services/payments/general_api.py +++ b/Adyen/services/payments/general_api.py @@ -11,12 +11,13 @@ class GeneralApi(AdyenServiceBase): def __init__(self, client=None): super(GeneralApi, self).__init__(client=client) self.service = "payments" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payment/v68" def authorise(self, request, idempotency_key=None, **kwargs): """ Create an authorisation """ - endpoint = f"/authorise" + endpoint = self.baseUrl + f"/authorise" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def authorise3d(self, request, idempotency_key=None, **kwargs): """ Complete a 3DS authorisation """ - endpoint = f"/authorise3d" + endpoint = self.baseUrl + f"/authorise3d" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def authorise3ds2(self, request, idempotency_key=None, **kwargs): """ Complete a 3DS2 authorisation """ - endpoint = f"/authorise3ds2" + endpoint = self.baseUrl + f"/authorise3ds2" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_authentication_result(self, request, idempotency_key=None, **kwargs): """ Get the 3DS authentication result """ - endpoint = f"/getAuthenticationResult" + endpoint = self.baseUrl + f"/getAuthenticationResult" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def retrieve3ds2_result(self, request, idempotency_key=None, **kwargs): """ Get the 3DS2 authentication result """ - endpoint = f"/retrieve3ds2Result" + endpoint = self.baseUrl + f"/retrieve3ds2Result" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/payments/modifications_api.py b/Adyen/services/payments/modifications_api.py index 5243984c..a1c59317 100644 --- a/Adyen/services/payments/modifications_api.py +++ b/Adyen/services/payments/modifications_api.py @@ -11,12 +11,13 @@ class ModificationsApi(AdyenServiceBase): def __init__(self, client=None): super(ModificationsApi, self).__init__(client=client) self.service = "payments" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payment/v68" def adjust_authorisation(self, request, idempotency_key=None, **kwargs): """ Change the authorised amount """ - endpoint = f"/adjustAuthorisation" + endpoint = self.baseUrl + f"/adjustAuthorisation" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def cancel(self, request, idempotency_key=None, **kwargs): """ Cancel an authorisation """ - endpoint = f"/cancel" + endpoint = self.baseUrl + f"/cancel" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def cancel_or_refund(self, request, idempotency_key=None, **kwargs): """ Cancel or refund a payment """ - endpoint = f"/cancelOrRefund" + endpoint = self.baseUrl + f"/cancelOrRefund" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def capture(self, request, idempotency_key=None, **kwargs): """ Capture an authorisation """ - endpoint = f"/capture" + endpoint = self.baseUrl + f"/capture" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def donate(self, request, idempotency_key=None, **kwargs): """ Create a donation """ - endpoint = f"/donate" + endpoint = self.baseUrl + f"/donate" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def refund(self, request, idempotency_key=None, **kwargs): """ Refund a captured payment """ - endpoint = f"/refund" + endpoint = self.baseUrl + f"/refund" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -64,7 +65,7 @@ def technical_cancel(self, request, idempotency_key=None, **kwargs): """ Cancel an authorisation using your reference """ - endpoint = f"/technicalCancel" + endpoint = self.baseUrl + f"/technicalCancel" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -72,7 +73,7 @@ def void_pending_refund(self, request, idempotency_key=None, **kwargs): """ Cancel an in-person refund """ - endpoint = f"/voidPendingRefund" + endpoint = self.baseUrl + f"/voidPendingRefund" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/payouts/initialization_api.py b/Adyen/services/payouts/initialization_api.py index 31b8fba1..4bf0fa57 100644 --- a/Adyen/services/payouts/initialization_api.py +++ b/Adyen/services/payouts/initialization_api.py @@ -11,12 +11,13 @@ class InitializationApi(AdyenServiceBase): def __init__(self, client=None): super(InitializationApi, self).__init__(client=client) self.service = "payouts" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payout/v68" def store_detail(self, request, idempotency_key=None, **kwargs): """ Store payout details """ - endpoint = f"/storeDetail" + endpoint = self.baseUrl + f"/storeDetail" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def store_detail_and_submit_third_party(self, request, idempotency_key=None, **k """ Store details and submit a payout """ - endpoint = f"/storeDetailAndSubmitThirdParty" + endpoint = self.baseUrl + f"/storeDetailAndSubmitThirdParty" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def submit_third_party(self, request, idempotency_key=None, **kwargs): """ Submit a payout """ - endpoint = f"/submitThirdParty" + endpoint = self.baseUrl + f"/submitThirdParty" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/payouts/instant_payouts_api.py b/Adyen/services/payouts/instant_payouts_api.py index b4d2deae..4459192d 100644 --- a/Adyen/services/payouts/instant_payouts_api.py +++ b/Adyen/services/payouts/instant_payouts_api.py @@ -11,12 +11,13 @@ class InstantPayoutsApi(AdyenServiceBase): def __init__(self, client=None): super(InstantPayoutsApi, self).__init__(client=client) self.service = "payouts" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payout/v68" def payout(self, request, idempotency_key=None, **kwargs): """ Make an instant card payout """ - endpoint = f"/payout" + endpoint = self.baseUrl + f"/payout" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/payouts/reviewing_api.py b/Adyen/services/payouts/reviewing_api.py index ffc1976a..18758517 100644 --- a/Adyen/services/payouts/reviewing_api.py +++ b/Adyen/services/payouts/reviewing_api.py @@ -11,12 +11,13 @@ class ReviewingApi(AdyenServiceBase): def __init__(self, client=None): super(ReviewingApi, self).__init__(client=client) self.service = "payouts" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Payout/v68" def confirm_third_party(self, request, idempotency_key=None, **kwargs): """ Confirm a payout """ - endpoint = f"/confirmThirdParty" + endpoint = self.baseUrl + f"/confirmThirdParty" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def decline_third_party(self, request, idempotency_key=None, **kwargs): """ Cancel a payout """ - endpoint = f"/declineThirdParty" + endpoint = self.baseUrl + f"/declineThirdParty" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/recurring.py b/Adyen/services/recurring.py index e1005115..ff06b2e5 100644 --- a/Adyen/services/recurring.py +++ b/Adyen/services/recurring.py @@ -11,12 +11,13 @@ class AdyenRecurringApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenRecurringApi, self).__init__(client=client) self.service = "recurring" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/Recurring/v68" def create_permit(self, request, idempotency_key=None, **kwargs): """ Create new permits linked to a recurring contract. """ - endpoint = f"/createPermit" + endpoint = self.baseUrl + f"/createPermit" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def disable(self, request, idempotency_key=None, **kwargs): """ Disable stored payment details """ - endpoint = f"/disable" + endpoint = self.baseUrl + f"/disable" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def disable_permit(self, request, idempotency_key=None, **kwargs): """ Disable an existing permit. """ - endpoint = f"/disablePermit" + endpoint = self.baseUrl + f"/disablePermit" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def list_recurring_details(self, request, idempotency_key=None, **kwargs): """ Get stored payment details """ - endpoint = f"/listRecurringDetails" + endpoint = self.baseUrl + f"/listRecurringDetails" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def notify_shopper(self, request, idempotency_key=None, **kwargs): """ Ask issuer to notify the shopper """ - endpoint = f"/notifyShopper" + endpoint = self.baseUrl + f"/notifyShopper" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def schedule_account_updater(self, request, idempotency_key=None, **kwargs): """ Schedule running the Account Updater """ - endpoint = f"/scheduleAccountUpdater" + endpoint = self.baseUrl + f"/scheduleAccountUpdater" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/storedValue.py b/Adyen/services/storedValue.py index 20a850fb..05b7877e 100644 --- a/Adyen/services/storedValue.py +++ b/Adyen/services/storedValue.py @@ -11,12 +11,13 @@ class AdyenStoredValueApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenStoredValueApi, self).__init__(client=client) self.service = "storedValue" + self.baseUrl = "https://pal-test.adyen.com/pal/servlet/StoredValue/v46" def change_status(self, request, idempotency_key=None, **kwargs): """ Changes the status of the payment method. """ - endpoint = f"/changeStatus" + endpoint = self.baseUrl + f"/changeStatus" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def check_balance(self, request, idempotency_key=None, **kwargs): """ Checks the balance. """ - endpoint = f"/checkBalance" + endpoint = self.baseUrl + f"/checkBalance" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def issue(self, request, idempotency_key=None, **kwargs): """ Issues a new card. """ - endpoint = f"/issue" + endpoint = self.baseUrl + f"/issue" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def load(self, request, idempotency_key=None, **kwargs): """ Loads the payment method. """ - endpoint = f"/load" + endpoint = self.baseUrl + f"/load" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def merge_balance(self, request, idempotency_key=None, **kwargs): """ Merge the balance of two cards. """ - endpoint = f"/mergeBalance" + endpoint = self.baseUrl + f"/mergeBalance" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -56,7 +57,7 @@ def void_transaction(self, request, idempotency_key=None, **kwargs): """ Voids a transaction. """ - endpoint = f"/voidTransaction" + endpoint = self.baseUrl + f"/voidTransaction" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/terminal.py b/Adyen/services/terminal.py index 06b4703d..df1a6477 100644 --- a/Adyen/services/terminal.py +++ b/Adyen/services/terminal.py @@ -11,12 +11,13 @@ class AdyenTerminalApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenTerminalApi, self).__init__(client=client) self.service = "terminal" + self.baseUrl = "https://postfmapi-test.adyen.com/postfmapi/terminal/v1" def assign_terminals(self, request, idempotency_key=None, **kwargs): """ Assign terminals """ - endpoint = f"/assignTerminals" + endpoint = self.baseUrl + f"/assignTerminals" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def find_terminal(self, request, idempotency_key=None, **kwargs): """ Get the account or store of a terminal """ - endpoint = f"/findTerminal" + endpoint = self.baseUrl + f"/findTerminal" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -32,7 +33,7 @@ def get_stores_under_account(self, request, idempotency_key=None, **kwargs): """ Get the stores of an account """ - endpoint = f"/getStoresUnderAccount" + endpoint = self.baseUrl + f"/getStoresUnderAccount" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -40,7 +41,7 @@ def get_terminal_details(self, request, idempotency_key=None, **kwargs): """ Get the details of a terminal """ - endpoint = f"/getTerminalDetails" + endpoint = self.baseUrl + f"/getTerminalDetails" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) @@ -48,7 +49,7 @@ def get_terminals_under_account(self, request, idempotency_key=None, **kwargs): """ Get the list of terminals """ - endpoint = f"/getTerminalsUnderAccount" + endpoint = self.baseUrl + f"/getTerminalsUnderAccount" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/transfers/__init__.py b/Adyen/services/transfers/__init__.py index 9627b9c2..f19d7005 100644 --- a/Adyen/services/transfers/__init__.py +++ b/Adyen/services/transfers/__init__.py @@ -1,5 +1,4 @@ from ..base import AdyenServiceBase -from .capital_api import CapitalApi from .transactions_api import TransactionsApi from .transfers_api import TransfersApi @@ -13,6 +12,5 @@ class AdyenTransfersApi(AdyenServiceBase): def __init__(self, client=None): super(AdyenTransfersApi, self).__init__(client=client) - self.capital_api = CapitalApi(client=client) self.transactions_api = TransactionsApi(client=client) self.transfers_api = TransfersApi(client=client) diff --git a/Adyen/services/transfers/capital_api.py b/Adyen/services/transfers/capital_api.py deleted file mode 100644 index 2170bddf..00000000 --- a/Adyen/services/transfers/capital_api.py +++ /dev/null @@ -1,38 +0,0 @@ -from ..base import AdyenServiceBase - - -class CapitalApi(AdyenServiceBase): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, client=None): - super(CapitalApi, self).__init__(client=client) - self.service = "transfers" - - def get_capital_account(self, idempotency_key=None, **kwargs): - """ - Get a capital account - """ - endpoint = f"/grants" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def get_grant_reference_details(self, id, idempotency_key=None, **kwargs): - """ - Get grant reference details - """ - endpoint = f"/grants/{id}" - method = "GET" - return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) - - def request_grant_payout(self, request, idempotency_key=None, **kwargs): - """ - Request a grant payout - """ - endpoint = f"/grants" - method = "POST" - return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) - diff --git a/Adyen/services/transfers/transactions_api.py b/Adyen/services/transfers/transactions_api.py index 33b6cf07..272512fd 100644 --- a/Adyen/services/transfers/transactions_api.py +++ b/Adyen/services/transfers/transactions_api.py @@ -11,12 +11,13 @@ class TransactionsApi(AdyenServiceBase): def __init__(self, client=None): super(TransactionsApi, self).__init__(client=client) self.service = "transfers" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/btl/v3" def get_all_transactions(self, idempotency_key=None, **kwargs): """ Get all transactions """ - endpoint = f"/transactions" + endpoint = self.baseUrl + f"/transactions" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) @@ -24,7 +25,7 @@ def get_transaction(self, id, idempotency_key=None, **kwargs): """ Get a transaction """ - endpoint = f"/transactions/{id}" + endpoint = self.baseUrl + f"/transactions/{id}" method = "GET" return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/services/transfers/transfers_api.py b/Adyen/services/transfers/transfers_api.py index c0724e20..977a4b1f 100644 --- a/Adyen/services/transfers/transfers_api.py +++ b/Adyen/services/transfers/transfers_api.py @@ -11,12 +11,13 @@ class TransfersApi(AdyenServiceBase): def __init__(self, client=None): super(TransfersApi, self).__init__(client=client) self.service = "transfers" + self.baseUrl = "https://balanceplatform-api-test.adyen.com/btl/v3" def transfer_funds(self, request, idempotency_key=None, **kwargs): """ Transfer funds """ - endpoint = f"/transfers" + endpoint = self.baseUrl + f"/transfers" method = "POST" return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/Adyen/settings.py b/Adyen/settings.py index f87da537..726ea6cd 100644 --- a/Adyen/settings.py +++ b/Adyen/settings.py @@ -1,29 +1,2 @@ -# Those constants are used from the library only -BASE_DATA_PROTECION_URL = "https://ca-{}.adyen.com/ca/services/DataProtectionService" -BASE_CONFIGURATION_URL = "https://balanceplatform-api-{}.adyen.com/bcl" -BASE_BTL_URL = "https://balanceplatform-api-{}.adyen.com/btl" -BASE_TERMINAL_URL = "https://postfmapi-{}.adyen.com/postfmapi/terminal" -BASE_MANAGEMENT_URL = "https://management-{}.adyen.com" -BASE_LEGAL_ENTITY_MANAGEMENT_URL = "https://kyc-{}.adyen.com/lem" -PAL_LIVE_ENDPOINT_URL_TEMPLATE = "https://{live_prefix}-pal-live" \ - ".adyenpayments.com/pal/servlet" -PAL_TEST_URL = "https://pal-test.adyen.com/pal/servlet" -ENDPOINT_CHECKOUT_TEST = "https://checkout-test.adyen.com" -ENDPOINT_CHECKOUT_LIVE_SUFFIX = "https://{live_prefix}-checkout-live" \ - ".adyenpayments.com/checkout" -BASE_STORED_VALUE_URL = "https://pal-{}.adyen.com/pal/servlet/StoredValue" -API_BALANCE_PLATFORM_VERSION = "v2" -API_BIN_LOOKUP_VERSION = "v52" -API_CHECKOUT_VERSION = "v70" -API_CHECKOUT_UTILITY_VERSION = "v1" -API_DATA_PROTECION_VERSION = "v1" -API_MANAGEMENT_VERSION = "v1" -API_RECURRING_VERSION = "v68" -API_PAYMENT_VERSION = "v68" -API_PAYOUT_VERSION = "v68" -API_TERMINAL_VERSION = "v1" -API_TRANSFERS_VERSION = "v3" -API_LEGAL_ENTITY_MANAGEMENT_VERSION = "v3" -API_STORED_VALUE_VERSION = "v46" LIB_NAME = "adyen-python-api-library" LIB_VERSION = "9.0.2" diff --git a/templates/api-small.mustache b/templates/api-small.mustache index b942612f..a0e93671 100644 --- a/templates/api-small.mustache +++ b/templates/api-small.mustache @@ -11,6 +11,7 @@ class Adyen{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}Api(AdyenSer def __init__(self, client=None): super(Adyen{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}Api, self).__init__(client=client) self.service = "{{serviceName}}" + self.baseUrl = "{{basePath}}" {{#operations}} {{#operation}} @@ -18,7 +19,7 @@ class Adyen{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}Api(AdyenSer """ {{{summary}}}{{^summary}}{{operationId}}{{/summary}} """ - endpoint = f"{{{path}}}" + endpoint = self.baseUrl + f"{{{path}}}" method = "{{httpMethod}}" {{#bodyParams}} return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/templates/api.mustache b/templates/api.mustache index 77d77601..9da2244f 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -11,6 +11,7 @@ class {{classname}}(AdyenServiceBase): def __init__(self, client=None): super({{classname}}, self).__init__(client=client) self.service = "{{serviceName}}" + self.baseUrl = "{{basePath}}" {{#operations}} {{#operation}} @@ -18,7 +19,7 @@ class {{classname}}(AdyenServiceBase): """ {{{summary}}}{{^summary}}{{operationId}}{{/summary}} """ - endpoint = f"{{{path}}}" + endpoint = self.baseUrl + f"{{{path}}}" method = "{{httpMethod}}" {{#bodyParams}} return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) diff --git a/test/BinLookupTest.py b/test/BinLookupTest.py index bb57629e..8a428765 100644 --- a/test/BinLookupTest.py +++ b/test/BinLookupTest.py @@ -21,7 +21,7 @@ class TestBinLookup(unittest.TestCase): client.username = "YourWSUser" client.password = "YourWSPassword" client.platform = "test" - binLookup_version = settings.API_BIN_LOOKUP_VERSION + binLookup_version = ady.binlookup.baseUrl.split('/')[-1] def test_get_cost_estimate_success(self): self.ady.client.http_client.request.reset_mock() diff --git a/test/CheckoutTest.py b/test/CheckoutTest.py index ca3e1a1f..ff091942 100644 --- a/test/CheckoutTest.py +++ b/test/CheckoutTest.py @@ -15,7 +15,7 @@ class TestCheckout(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - checkout_version = settings.API_CHECKOUT_VERSION + baseUrl = adyen.checkout.classic_checkout_sdk_api.baseUrl lib_version = settings.LIB_VERSION def test_payment_methods_success_mocked(self): @@ -95,7 +95,7 @@ def test_payments_error_mocked(self): self.adyen.client.http_client.request.assert_called_once_with( 'POST', - 'https://checkout-test.adyen.com/{}/payments'.format(self.checkout_version), + f'{self.baseUrl}/payments', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ 'returnUrl': 'https://your-company.com/...', @@ -133,7 +133,7 @@ def test_payments_details_success_mocked(self): self.adyen.client.http_client.request.assert_called_once_with( 'POST', - u'https://checkout-test.adyen.com/{}/payments/details'.format(self.checkout_version), + f'{self.baseUrl}/payments/details', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ 'paymentData': 'Hee57361f99....', @@ -389,7 +389,7 @@ def test_payments_capture_success_mocked(self): result = self.adyen.checkout.modifications_api.capture_authorised_payment(request, psp_reference) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/payments/{psp_reference}/captures', + f'{self.baseUrl}/payments/{psp_reference}/captures', json=request, xapikey='YourXapikey', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, @@ -431,7 +431,7 @@ def test_orders_success(self): result = self.adyen.checkout.orders_api.orders(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/orders', + f'{self.baseUrl}/orders', json=request, xapikey='YourXapikey', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, @@ -453,7 +453,7 @@ def test_orders_cancel_success(self): result = self.adyen.checkout.orders_api.cancel_order(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/orders/cancel', + f'{self.baseUrl}/orders/cancel', json=request, xapikey='YourXapikey', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, @@ -472,7 +472,7 @@ def test_paymentmethods_balance_success(self): result = self.adyen.checkout.orders_api.get_balance_of_gift_card(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/paymentMethods/balance', + f'{self.baseUrl}/paymentMethods/balance', json=request, xapikey='YourXapikey', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, @@ -508,7 +508,7 @@ def test_sessions_error(self): result = self.adyen.checkout.payments_api.sessions(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/sessions', + f'{self.baseUrl}/sessions', json={'merchantAccount': 'YourMerchantAccount'}, xapikey='YourXapikey', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, @@ -555,7 +555,7 @@ def test_payment_link(self): result = self.adyen.checkout.payment_links_api.payment_links(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://checkout-test.adyen.com/{self.checkout_version}/paymentLinks', + f'{self.baseUrl}/paymentLinks', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, xapikey='YourXapikey', json=request @@ -572,7 +572,7 @@ def test_get_payment_link(self): result = self.adyen.checkout.payment_links_api.get_payment_link(id) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://checkout-test.adyen.com/{self.checkout_version}/paymentLinks/{id}', + f'{self.baseUrl}/paymentLinks/{id}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, xapikey="YourXapikey", json=None @@ -591,7 +591,7 @@ def test_update_payment_link(self): result = self.adyen.checkout.payment_links_api.update_payment_link(request, id) self.adyen.client.http_client.request.assert_called_once_with( 'PATCH', - f'https://checkout-test.adyen.com/{self.checkout_version}/paymentLinks/{id}', + f'{self.baseUrl}/paymentLinks/{id}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, xapikey="YourXapikey", json=request diff --git a/test/CheckoutUtilityTest.py b/test/CheckoutUtilityTest.py index 059456ee..61eb400a 100644 --- a/test/CheckoutUtilityTest.py +++ b/test/CheckoutUtilityTest.py @@ -15,7 +15,7 @@ class TestCheckoutUtility(unittest.TestCase): test = BaseTest(ady) client.xapikey = "YourXapikey" client.platform = "test" - checkout_version = settings.API_CHECKOUT_VERSION + checkout_url = ady.checkout.classic_checkout_sdk_api.baseUrl def test_origin_keys_success_mocked(self): request = { @@ -52,9 +52,9 @@ def test_origin_keys_success_mocked(self): ['https://www.your-domain2.com']) def test_checkout_utility_api_url_custom(self): - url = self.ady.client._determine_api_url("test", "checkout", "/originKeys") + url = self.ady.client._determine_api_url("test", self.checkout_url + "/originKeys") - self.assertEqual(url, "https://checkout-test.adyen.com/{}/originKeys".format(self.checkout_version)) + self.assertEqual(url, f"{self.checkout_url}/originKeys") def test_applePay_session(self): request = { diff --git a/test/ConfigurationTest.py b/test/ConfigurationTest.py index 3953ccfc..3bbb9f07 100644 --- a/test/ConfigurationTest.py +++ b/test/ConfigurationTest.py @@ -15,7 +15,7 @@ class TestManagement(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - balance_platform_version = settings.API_BALANCE_PLATFORM_VERSION + balance_platform_url = adyen.balancePlatform.platform_api.baseUrl def test_creating_balance_account(self): request = { @@ -29,7 +29,7 @@ def test_creating_balance_account(self): self.assertEqual('AH32272223222B59K6ZKBBFNQ', result.message['accountHolderId']) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/balanceAccounts', + f'{self.balance_platform_url}/balanceAccounts', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -47,7 +47,7 @@ def test_creating_account_holder(self): self.assertEqual("LE322JV223222D5GG42KN6869", result.message['legalEntityId']) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/accountHolders', + f'{self.balance_platform_url}/accountHolders', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -61,7 +61,7 @@ def test_get_balance_platform(self): self.assertEqual(platform_id, result.message['id']) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/balancePlatforms/{platform_id}', + f'{self.balance_platform_url}/balancePlatforms/{platform_id}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" @@ -80,7 +80,7 @@ def test_creating_payment_instrument(self): self.assertEqual("BA3227C223222B5CTBLR8BWJB", result.message["balanceAccountId"]) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/paymentInstruments', + f'{self.balance_platform_url}/paymentInstruments', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -97,7 +97,7 @@ def test_creating_payment_instrument_group(self): self.assertEqual("YOUR_BALANCE_PLATFORM", result.message['balancePlatform']) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/paymentInstrumentGroups', + f'{self.balance_platform_url}/paymentInstrumentGroups', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -111,7 +111,7 @@ def test_get_transaction_rule(self): self.assertEqual(transactionRuleId, result.message['transactionRule']['id']) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://balanceplatform-api-test.adyen.com/bcl/{self.balance_platform_version}/' + f'{self.balance_platform_url}/' f'transactionRules/{transactionRuleId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, diff --git a/test/DataProtectionTest.py b/test/DataProtectionTest.py index 56e9252d..b4161e4d 100644 --- a/test/DataProtectionTest.py +++ b/test/DataProtectionTest.py @@ -15,7 +15,7 @@ class TestCheckout(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - data_protection_version = settings.API_DATA_PROTECION_VERSION + data_protection_url = adyen.dataProtection.baseUrl lib_version = settings.LIB_VERSION def test_data_erasure(self): @@ -29,7 +29,7 @@ def test_data_erasure(self): result = self.adyen.dataProtection.request_subject_erasure(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://ca-test.adyen.com/ca/services/DataProtectionService/{self.data_protection_version}' + f'{self.data_protection_url}' '/requestSubjectErasure', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, xapikey="YourXapikey", diff --git a/test/DetermineEndpointTest.py b/test/DetermineEndpointTest.py index 36d1da6f..946c745e 100644 --- a/test/DetermineEndpointTest.py +++ b/test/DetermineEndpointTest.py @@ -16,23 +16,23 @@ class TestDetermineUrl(unittest.TestCase): client = adyen.client test = BaseTest(adyen) client.xapikey = "YourXapikey" - checkout_version = settings.API_CHECKOUT_VERSION - payment_version = settings.API_PAYMENT_VERSION - binLookup_version = settings.API_BIN_LOOKUP_VERSION - management_version = settings.API_MANAGEMENT_VERSION + checkout_url = adyen.checkout.classic_checkout_sdk_api.baseUrl + checkout_version = checkout_url.split('/')[-1] + payment_url = adyen.payment.general_api.baseUrl + payment_version = payment_url.split('/')[-1] + binlookup_url = adyen.binlookup.baseUrl + management_url = adyen.management.account_merchant_level_api.baseUrl def test_checkout_api_url_custom(self): self.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo" - url = self.adyen.client._determine_api_url("live", "checkout", "/payments") + url = self.adyen.client._determine_api_url("live", self.checkout_url + "/payments") self.assertEqual("https://1797a841fbb37ca7-AdyenDemo-checkout-" f"live.adyenpayments.com/checkout/{self.checkout_version}/payments", url) def test_checkout_api_url(self): self.client.live_endpoint_prefix = None - url = self.adyen.client._determine_api_url("test", "checkout", - "/payments/details") - self.assertEqual(url, "https://checkout-test.adyen.com" - f"/{self.checkout_version}/payments/details") + url = self.adyen.client._determine_api_url("test", self.checkout_url + "/payments/details") + self.assertEqual(url, f"{self.checkout_url}/payments/details") def test_payments_invalid_platform(self): @@ -62,7 +62,7 @@ def test_payments_invalid_platform(self): def test_pal_url_live_endpoint_prefix_live_platform(self): self.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo" url = self.adyen.client._determine_api_url( - "live", "payments", "/payments" + "live", self.payment_url + "/payments" ) self.assertEqual( url, @@ -73,63 +73,53 @@ def test_pal_url_live_endpoint_prefix_live_platform(self): def test_pal_url_live_endpoint_prefix_test_platform(self): self.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo" url = self.adyen.client._determine_api_url( - "test", "payments", "/payments" + "test", self.payment_url + "/payments" ) self.assertEqual( url, - f"https://pal-test.adyen.com/pal/servlet/Payment/{self.payment_version}/payments") + f"{self.payment_url}/payments") def test_pal_url_no_live_endpoint_prefix_test_platform(self): self.client.live_endpoint_prefix = None url = self.adyen.client._determine_api_url( - "test", "payments", "/payments" + "test", self.payment_url + "/payments" ) self.assertEqual( url, - f"https://pal-test.adyen.com/pal/servlet/Payment/{self.payment_version}/payments") + f"{self.payment_url}/payments") def test_binlookup_url_no_live_endpoint_prefix_test_platform(self): self.client.live_endpoint_prefix = None url = self.adyen.client._determine_api_url( - "test", "binlookup", "/get3dsAvailability" + "test", self.binlookup_url + "/get3dsAvailability" ) self.assertEqual( url, - ("https://pal-test.adyen.com/pal/servlet/" - f"BinLookup/{self.binLookup_version}/get3dsAvailability") + f"{self.binlookup_url}/get3dsAvailability" ) def test_checkout_api_url_orders(self): self.client.live_endpoint_prefix = None - url = self.adyen.client._determine_api_url("test", "checkout", + url = self.adyen.client._determine_api_url("test", self.checkout_url + "/orders") - self.assertEqual(url, "https://checkout-test.adyen.com" - f"/{self.checkout_version}/orders") + self.assertEqual(url, f"{self.checkout_url}/orders") def test_checkout_api_url_order_cancel(self): self.client.live_endpoint_prefix = None - url = self.adyen.client._determine_api_url("test", "checkout", - "/orders/cancel") - self.assertEqual(url, "https://checkout-test.adyen.com" - f"/{self.checkout_version}/orders/cancel") + url = self.adyen.client._determine_api_url("test", self.checkout_url + "/orders/cancel") + self.assertEqual(url, f"{self.checkout_url}/orders/cancel") def test_checkout_api_url_order_payment_methods_balance(self): self.client.live_endpoint_prefix = None - url = self.adyen.client._determine_api_url("test", "checkout", - "/paymentMethods/" - "balance") - self.assertEqual(url, f"https://checkout-test.adyen.com/{self.checkout_version}/" - "paymentMethods/balance") + url = self.adyen.client._determine_api_url("test", self.checkout_url + "/paymentMethods/balance") + self.assertEqual(url, f"{self.checkout_url}/paymentMethods/balance") def test_checkout_api_url_sessions(self): self.client.live_endpoint_prefix = None - url = self.adyen.client._determine_api_url("test", "checkout", - "/sessions") - self.assertEqual(url, f"https://checkout-test.adyen.com/{self.checkout_version}/" - "sessions") + url = self.adyen.client._determine_api_url("test", self.checkout_url + "/sessions") + self.assertEqual(url, f"{self.checkout_url}/sessions") def test_management_api_url_companies(self): companyId = "YOUR_COMPANY_ID" - url = self.adyen.client._determine_api_url("test", "management", f'/companies/{companyId}/users') - self.assertEqual(url, f"https://management-test.adyen.com/{self.management_version}/" - "companies/YOUR_COMPANY_ID/users") + url = self.adyen.client._determine_api_url("test", self.management_url + f'/companies/{companyId}/users') + self.assertEqual(url, f"{self.management_url}/companies/{companyId}/users") diff --git a/test/LegalEntityManagementTest.py b/test/LegalEntityManagementTest.py index 23872d2e..64ddb330 100644 --- a/test/LegalEntityManagementTest.py +++ b/test/LegalEntityManagementTest.py @@ -15,7 +15,7 @@ class TestManagement(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - lem_version = settings.API_LEGAL_ENTITY_MANAGEMENT_VERSION + lem_url = adyen.legalEntityManagement.legal_entities_api.baseUrl def test_creating_legal_entity(self): request = { @@ -44,7 +44,7 @@ def test_creating_legal_entity(self): self.assertEqual('Shelly', result.message['individual']['name']['firstName']) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://kyc-test.adyen.com/lem/{self.lem_version}/legalEntities', + f'{self.lem_url}/legalEntities', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -58,7 +58,7 @@ def test_get_transfer_instrument(self): self.assertEqual(instrumentId, result.message['id']) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://kyc-test.adyen.com/lem/{self.lem_version}/transferInstruments/{instrumentId}', + f'{self.lem_url}/transferInstruments/{instrumentId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" @@ -80,7 +80,7 @@ def test_update_business_line(self): self.assertEqual(businessLineId, result.message['id']) self.adyen.client.http_client.request.assert_called_once_with( 'PATCH', - f'https://kyc-test.adyen.com/lem/{self.lem_version}/businessLines/{businessLineId}', + f'{self.lem_url}/businessLines/{businessLineId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -98,7 +98,7 @@ def test_accept_terms_of_service(self): documentId) self.adyen.client.http_client.request.assert_called_once_with( 'PATCH', - f'https://kyc-test.adyen.com/lem/{self.lem_version}/legalEntities/{legalEntityId}/termsOfService/{documentId}', + f'{self.lem_url}/legalEntities/{legalEntityId}/termsOfService/{documentId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" diff --git a/test/ManagementTest.py b/test/ManagementTest.py index 89dd99bd..eff4e17c 100644 --- a/test/ManagementTest.py +++ b/test/ManagementTest.py @@ -15,7 +15,7 @@ class TestManagement(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - management_version = settings.API_MANAGEMENT_VERSION + management_url = adyen.management.my_api_credential_api.baseUrl def test_get_company_account(self): request = None @@ -30,7 +30,7 @@ def test_get_company_account(self): self.assertEqual(id, result.message['id']) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://management-test.adyen.com/{self.management_version}/companies/{id}', + f'{self.management_url}/companies/{id}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" @@ -53,7 +53,7 @@ def test_my_api_credential_api(self): result = self.adyen.management.my_api_credential_api.remove_allowed_origin(originId) self.adyen.client.http_client.request.assert_called_once_with( 'DELETE', - f'https://management-test.adyen.com/{self.management_version}/me/allowedOrigins/{originId}', + f'{self.management_url}/me/allowedOrigins/{originId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" @@ -78,7 +78,7 @@ def test_update_a_store(self): result = self.adyen.management.account_store_level_api.update_store(request, merchantId, storeId) self.adyen.client.http_client.request.assert_called_once_with( 'PATCH', - f'https://management-test.adyen.com/{self.management_version}/merchants/{merchantId}/stores/{storeId}', + f'{self.management_url}/merchants/{merchantId}/stores/{storeId}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -113,7 +113,7 @@ def test_create_a_user(self): self.assertEqual(request['name']['firstName'], result.message['name']['firstName']) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://management-test.adyen.com/{self.management_version}/companies/{companyId}/users', + f'{self.management_url}/companies/{companyId}/users', json=request, headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, xapikey="YourXapikey" @@ -147,7 +147,7 @@ def test_query_paramaters(self): list_merchant_accounts(companyId, query_parameters=query_parameters) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://management-test.adyen.com/{self.management_version}/companies/{companyId}/merchants?pageNumber=1&pageSize=10', + f'{self.management_url}/companies/{companyId}/merchants?pageNumber=1&pageSize=10', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" diff --git a/test/RecurringTest.py b/test/RecurringTest.py index 2b73e43a..0783d9ec 100644 --- a/test/RecurringTest.py +++ b/test/RecurringTest.py @@ -14,7 +14,7 @@ class TestRecurring(unittest.TestCase): client.username = "YourWSUser" client.password = "YourWSPassword" client.platform = "test" - recurring_version = settings.API_RECURRING_VERSION + baseUrl = adyen.recurring.baseUrl def test_list_recurring_details(self): request = {} @@ -33,7 +33,7 @@ def test_list_recurring_details(self): result = self.adyen.recurring.list_recurring_details(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Recurring/{self.recurring_version}/listRecurringDetails', + f'{self.baseUrl}/listRecurringDetails', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -60,7 +60,7 @@ def test_disable(self): result = self.adyen.recurring.disable(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Recurring/{self.recurring_version}/disable', + f'{self.baseUrl}/disable', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', diff --git a/test/StoredValueTest.py b/test/StoredValueTest.py index 8fab0fcc..790e9f68 100644 --- a/test/StoredValueTest.py +++ b/test/StoredValueTest.py @@ -15,7 +15,7 @@ class TestManagement(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - stored_value_version = settings.API_STORED_VALUE_VERSION + stored_value_url = adyen.storedValue.baseUrl def issue(self): request = { @@ -34,7 +34,7 @@ def issue(self): self.assertEqual(result.message['paymentMethod']['type'], 'givex') self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/issue', + f'{self.stored_value_url}/issue', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -62,7 +62,7 @@ def test_activate_giftcard(self): self.assertEqual(result.message['currentBalance']['value'], 1000) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/changeStatus', + f'{self.stored_value_url}/changeStatus', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -89,7 +89,7 @@ def test_load_funds(self): self.assertEqual(result.message['resultCode'], 'Success') self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/load', + f'{self.stored_value_url}/load', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -111,7 +111,7 @@ def test_check_balance(self): self.assertEqual(result.message['currentBalance']['value'], 5600) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/checkBalance', + f'{self.stored_value_url}/checkBalance', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -137,7 +137,7 @@ def test_merge_balance(self): self.assertEqual(result.message['pspReference'], "881564657480267D") self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/mergeBalance', + f'{self.stored_value_url}/mergeBalance', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -154,7 +154,7 @@ def test_void_transaction(self): result = self.adyen.storedValue.void_transaction(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/StoredValue/{self.stored_value_version}/voidTransaction', + f'{self.stored_value_url}/voidTransaction', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" diff --git a/test/TerminalTest.py b/test/TerminalTest.py index fd4acf1e..dc711f43 100644 --- a/test/TerminalTest.py +++ b/test/TerminalTest.py @@ -15,7 +15,7 @@ class TestTerminal(unittest.TestCase): xapikey="YourXapikey") test = BaseTest(adyen) client = adyen.client - terminal_version = settings.API_TERMINAL_VERSION + terminal_url = adyen.terminal.baseUrl def test_assign_terminals(self): request = { @@ -34,7 +34,7 @@ def test_assign_terminals(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/assignTerminals", + f"{self.terminal_url}/assignTerminals", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "companyAccount": "YOUR_COMPANY_ACCOUNT", @@ -78,7 +78,7 @@ def test_find_terminal(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/findTerminal", + f"{self.terminal_url}/findTerminal", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "terminal": "P400Plus-275479597", @@ -126,7 +126,7 @@ def test_get_stores_under_account(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/getStoresUnderAccount", + f"{self.terminal_url}/getStoresUnderAccount", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "companyAccount": "YOUR_COMPANY_ACCOUNT", @@ -151,7 +151,7 @@ def test_get_terminal_details(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/getTerminalDetails", + f"{self.terminal_url}/getTerminalDetails", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "terminal": "P400Plus-275479597", @@ -203,7 +203,7 @@ def test_get_terminals_under_account(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/getTerminalsUnderAccount", + f"{self.terminal_url}/getTerminalsUnderAccount", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "companyAccount": "YOUR_COMPANY_ACCOUNT", @@ -240,7 +240,7 @@ def test_get_terminals_under_account_store(self): self.client.http_client.request.assert_called_once_with( "POST", - f"https://postfmapi-test.adyen.com/postfmapi/terminal/{self.terminal_version}/getTerminalsUnderAccount", + f"{self.terminal_url}/getTerminalsUnderAccount", headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json={ "companyAccount": "YOUR_COMPANY_ACCOUNT", diff --git a/test/ThirdPartyPayoutTest.py b/test/ThirdPartyPayoutTest.py index 75c63176..7b95da3f 100644 --- a/test/ThirdPartyPayoutTest.py +++ b/test/ThirdPartyPayoutTest.py @@ -19,7 +19,7 @@ class TestThirdPartyPayout(unittest.TestCase): client.review_payout_password = "YourReviewPayoutPassword" client.store_payout_username = "YourStorePayoutUser" client.store_payout_password = "YourStorePayoutPassword" - payout_version = settings.API_PAYOUT_VERSION + payout_url = adyen.payout.initialization_api.baseUrl def test_confirm_success(self): request = { @@ -31,7 +31,7 @@ def test_confirm_success(self): result = self.adyen.payout.reviewing_api.confirm_third_party(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/confirmThirdParty', + f'{self.payout_url}/confirmThirdParty', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -65,7 +65,7 @@ def test_decline_success(self): result = self.adyen.payout.reviewing_api.decline_third_party(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/declineThirdParty', + f'{self.payout_url}/declineThirdParty', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -112,7 +112,7 @@ def test_store_detail_bank_success(self): result = self.adyen.payout.initialization_api.store_detail(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/storeDetail', + f'{self.payout_url}/storeDetail', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -142,7 +142,7 @@ def test_submit_success(self): result = self.adyen.payout.initialization_api.submit_third_party(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/submitThirdParty', + f'{self.payout_url}/submitThirdParty', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -285,7 +285,7 @@ def test_store_detail_and_submit_card_success(self): result = self.adyen.payout.initialization_api.store_detail_and_submit_third_party(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/storeDetailAndSubmitThirdParty', + f'{self.payout_url}/storeDetailAndSubmitThirdParty', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', @@ -319,7 +319,7 @@ def test_store_detail_and_submit_bank_success(self): result = self.adyen.payout.initialization_api.store_detail_and_submit_third_party(request) self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://pal-test.adyen.com/pal/servlet/Payout/{self.payout_version}/storeDetailAndSubmitThirdParty', + f'{self.payout_url}/storeDetailAndSubmitThirdParty', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, username='YourWSUser', diff --git a/test/TransfersTest.py b/test/TransfersTest.py index a946893d..70246ba2 100644 --- a/test/TransfersTest.py +++ b/test/TransfersTest.py @@ -15,7 +15,7 @@ class TestManagement(unittest.TestCase): test = BaseTest(adyen) client.xapikey = "YourXapikey" client.platform = "test" - transfers_version = settings.API_TRANSFERS_VERSION + transfers_url = adyen.transfers.transfers_api.baseUrl def test_transfer_fund(self): request = { @@ -57,7 +57,7 @@ def test_transfer_fund(self): self.adyen.client.http_client.request.assert_called_once_with( 'POST', - f'https://balanceplatform-api-test.adyen.com/btl/{self.transfers_version}/transfers', + f'{self.transfers_url}/transfers', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=request, xapikey="YourXapikey" @@ -70,7 +70,7 @@ def test_get_all_transactions(self): result = self.adyen.transfers.transactions_api.get_all_transactions() self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://balanceplatform-api-test.adyen.com/btl/{self.transfers_version}/transactions', + f'{self.transfers_url}/transactions', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" @@ -83,7 +83,7 @@ def test_get_transaction(self): result = self.adyen.transfers.transactions_api.get_transaction(transacion_id) self.adyen.client.http_client.request.assert_called_once_with( 'GET', - f'https://balanceplatform-api-test.adyen.com/btl/{self.transfers_version}/transactions/{transacion_id}', + f'{self.transfers_url}/transactions/{transacion_id}', headers={'adyen-library-name': 'adyen-python-api-library', 'adyen-library-version': settings.LIB_VERSION}, json=None, xapikey="YourXapikey" diff --git a/test/UtilTest.py b/test/UtilTest.py index d591e283..a71b3851 100644 --- a/test/UtilTest.py +++ b/test/UtilTest.py @@ -1,6 +1,7 @@ import unittest from json import load import Adyen +from Adyen import settings from Adyen.util import ( generate_notification_sig, is_valid_hmac_notification, @@ -13,8 +14,8 @@ class UtilTest(unittest.TestCase): - ady = Adyen.Adyen() - client = ady.client + adyen = Adyen.Adyen() + client = adyen.client def test_notification_request_item_hmac(self): request = { @@ -75,16 +76,35 @@ def test_query_string_creation(self): def test_passing_xapikey_in_method(self): request = {'merchantAccount': "YourMerchantAccount"} - self.test = BaseTest(self.ady) + self.test = BaseTest(self.adyen) self.client.platform = "test" - self.ady.client = self.test.create_client_from_file(200, request, + self.adyen.client = self.test.create_client_from_file(200, request, "test/mocks/" "checkout/" "paymentmethods" "-success.json") - result = self.ady.checkout.payments_api.payment_methods(request, xapikey="YourXapikey") + result = self.adyen.checkout.payments_api.payment_methods(request, xapikey="YourXapikey") self.assertEqual("AliPay", result.message['paymentMethods'][0]['name']) self.assertEqual("Credit Card", result.message['paymentMethods'][2]['name']) self.assertEqual("Credit Card via AsiaPay", - result.message['paymentMethods'][3]['name']) \ No newline at end of file + result.message['paymentMethods'][3]['name']) + + def test_custom_version(self): + self.client.api_checkout_version = 60 + request = {'merchantAccount': "YourMerchantAccount"} + self.test = BaseTest(self.adyen) + self.client.platform = "test" + self.adyen.client = self.test.create_client_from_file(200, request, + "test/mocks/" + "checkout/" + "paymentmethods" + "-success.json") + result = self.adyen.checkout.payments_api.payment_methods(request, xapikey="YourXapikey") + self.adyen.client.http_client.request.assert_called_once_with( + 'POST', + f'https://checkout-test.adyen.com/v{self.client.api_checkout_version}/paymentMethods', + headers={'adyen-library-name': settings.LIB_NAME, 'adyen-library-version': settings.LIB_VERSION}, + json=request, + xapikey="YourXapikey" + ) \ No newline at end of file From 81ad2045c8c840b7d153aab4434f739406904d88 Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Mon, 18 Sep 2023 12:42:00 +0000 Subject: [PATCH 2/2] chore(release): bump to 9.0.3 --- Adyen/settings.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Adyen/settings.py b/Adyen/settings.py index 726ea6cd..647f931a 100644 --- a/Adyen/settings.py +++ b/Adyen/settings.py @@ -1,2 +1,2 @@ LIB_NAME = "adyen-python-api-library" -LIB_VERSION = "9.0.2" +LIB_VERSION = "9.0.3" diff --git a/setup.py b/setup.py index ffd28f90..05e4d01a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='Adyen', packages=find_packages(include="Adyen*"), - version='9.0.2', + version='9.0.3', maintainer='Adyen', maintainer_email='support@adyen.com', description='Adyen Python Api',