diff --git a/Adyen/client.py b/Adyen/client.py index 2146bc80..059b976a 100644 --- a/Adyen/client.py +++ b/Adyen/client.py @@ -87,8 +87,8 @@ def __init__(self, username=None, password=None, xapikey=None, self.skin_code = skin_code self.psp_list = [] self.app_name = app_name - self.LIB_VERSION = "1.4.0" - self.USER_AGENT_SUFFIX = "adyen-python-api-library/" + self.LIB_VERSION = settings.LIB_VERSION + self.USER_AGENT_SUFFIX = settings.LIB_NAME + "/" self.http_init = False self.http_force = http_force self.live_endpoint_prefix = live_endpoint_prefix @@ -282,7 +282,13 @@ def call_api(self, request_data, service, action, idempotency=False, if not message.get('merchantAccount'): message['merchantAccount'] = self.merchant_account - + # Add application info + request_data['applicationInfo'] = { + "adyenLibrary": { + "name": settings.LIB_NAME, + "version": settings.LIB_VERSION + } + } # Adyen requires this header to be set and uses the combination of # merchant account and merchant reference to determine uniqueness. headers = {} @@ -424,6 +430,12 @@ def call_checkout_api(self, request_data, action, **kwargs): if not request_data.get('merchantAccount'): request_data['merchantAccount'] = self.merchant_account + request_data['applicationInfo'] = { + "adyenLibrary": { + "name": settings.LIB_NAME, + "version": settings.LIB_VERSION + } + } # Adyen requires this header to be set and uses the combination of # merchant account and merchant reference to determine uniqueness. headers = {} diff --git a/Adyen/settings.py b/Adyen/settings.py index d11759ee..348c0639 100644 --- a/Adyen/settings.py +++ b/Adyen/settings.py @@ -4,8 +4,10 @@ ENDPOINT_CHECKOUT_TEST = "https://checkout-test.adyen.com" ENDPOINT_CHECKOUT_LIVE_SUFFIX = "https://{}-checkout-live" \ ".adyenpayments.com/checkout" -API_CHECKOUT_VERSION = "v40" +API_CHECKOUT_VERSION = "v41" API_CHECKOUT_UTILITY_VERSION = "v1" API_RECURRING_VERSION = "v25" API_PAYMENT_VERSION = "v40" API_PAYOUT_VERSION = "v30" +LIB_VERSION = "2.0.0" +LIB_NAME = "adyen-python-api-library" diff --git a/README.md b/README.md index 825f9f8b..7ae623a8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,16 @@ This library simplifies working with Adyen APIs and allows you to integrate Adyen payments within any Python application. +## Integration +The Library supports all APIs under the following services: + +* checkout +* checkout utility +* payments +* modifications +* payouts +* recurring + ## Requirements - Python 2.7 or 3.6 @@ -35,9 +45,11 @@ ady.payment.client.app_name = "your app name" ``` ## Documentation +* https://docs.adyen.com/developers/development-resources/libraries +* https://docs.adyen.com/developers/checkout/api-integration -Follow the rest of our guides from the [documentation](http://adyen.github.io/adyen-python-api-library/index.html) on how to use this library. +## Support +If you have any problems, questions or suggestions, create an issue here or send your inquiry to support@adyen.com. ## Licence - MIT license see LICENSE diff --git a/setup.py b/setup.py index 53adcc86..497abf52 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='Adyen', packages=['Adyen'], - version='1.4.0', + version='2.0.0', maintainer='Adyen', maintainer_email='support@adyen.com', description='Adyen Python Api', diff --git a/test/DetermineEndpointTest.py b/test/DetermineEndpointTest.py index 9652b7b5..dade9be9 100644 --- a/test/DetermineEndpointTest.py +++ b/test/DetermineEndpointTest.py @@ -17,14 +17,14 @@ def test_checkout_api_url_custom(self): url = self.adyen.client._determine_checkout_url("live", "payments") self.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo" self.assertEqual(url, "https://1797a841fbb37ca7-AdyenDemo-checkout-" - "live.adyenpayments.com/checkout/v40/payments") + "live.adyenpayments.com/checkout/v41/payments") def test_checkout_api_url(self): self.client.live_endpoint_prefix = None url = self.adyen.client._determine_checkout_url("test", "paymentsDetails") self.assertEqual(url, "https://checkout-test.adyen.com" - "/v40/payments/details") + "/v41/payments/details") def test_payments_invalid_platform(self):