Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Adyen/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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 = {}
Expand Down
4 changes: 3 additions & 1 deletion Adyen/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions test/DetermineEndpointTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down