Skip to content

Commit 7eb7196

Browse files
authored
Release v4.0.0
2 parents cd10fc8 + 1ff60bb commit 7eb7196

File tree

4 files changed

+63
-15
lines changed

4 files changed

+63
-15
lines changed

Adyen/client.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -483,20 +483,30 @@ def call_checkout_api(self, request_data, action, **kwargs):
483483
if not request_data.get('merchantAccount'):
484484
request_data['merchantAccount'] = self.merchant_account
485485

486-
if 'applicationInfo' in request_data:
487-
request_data['applicationInfo'].update({
488-
"adyenLibrary": {
489-
"name": settings.LIB_NAME,
490-
"version": settings.LIB_VERSION
491-
}
492-
})
493-
else:
494-
request_data['applicationInfo'] = {
495-
"adyenLibrary": {
496-
"name": settings.LIB_NAME,
497-
"version": settings.LIB_VERSION
486+
with_app_info = [
487+
"authorise",
488+
"authorise3d",
489+
"authorise3ds2",
490+
"payments",
491+
"paymentSession",
492+
"paymentLinks"
493+
]
494+
495+
if action in with_app_info:
496+
if 'applicationInfo' in request_data:
497+
request_data['applicationInfo'].update({
498+
"adyenLibrary": {
499+
"name": settings.LIB_NAME,
500+
"version": settings.LIB_VERSION
501+
}
502+
})
503+
else:
504+
request_data['applicationInfo'] = {
505+
"adyenLibrary": {
506+
"name": settings.LIB_NAME,
507+
"version": settings.LIB_VERSION
508+
}
498509
}
499-
}
500510
# Adyen requires this header to be set and uses the combination of
501511
# merchant account and merchant reference to determine uniqueness.
502512
headers = {}

Adyen/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
API_RECURRING_VERSION = "v49"
1313
API_PAYMENT_VERSION = "v64"
1414
API_PAYOUT_VERSION = "v64"
15-
LIB_VERSION = "3.1.0"
15+
LIB_VERSION = "4.0.0"
1616
LIB_NAME = "adyen-python-api-library"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name='Adyen',
55
packages=['Adyen'],
6-
version='3.1.0',
6+
version='4.0.0',
77
maintainer='Adyen',
88
maintainer_email='support@adyen.com',
99
description='Adyen Python Api',

test/CheckoutTest.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,32 @@ def test_payments_error_mocked(self):
8989
"-data-422"
9090
".json")
9191
result = self.adyen.checkout.payments(request)
92+
93+
self.adyen.client.http_client.request.assert_called_once_with(
94+
'https://checkout-test.adyen.com/v64/payments',
95+
headers={},
96+
json={
97+
'returnUrl': 'https://your-company.com/...',
98+
u'applicationInfo': {
99+
u'adyenLibrary': {
100+
u'version': '4.0.0',
101+
u'name': 'adyen-python-api-library'
102+
}
103+
},
104+
'reference': '54431',
105+
'merchantAccount': 'YourMerchantAccount',
106+
'amount': {'currency': 'EUR', 'value': '100000'},
107+
'paymentMethod': {
108+
'expiryYear': '2018',
109+
'holderName': 'John Smith',
110+
'number': '4111111111111111',
111+
'expiryMonth': '08',
112+
'type': 'scheme',
113+
'cvc': '737'
114+
}
115+
},
116+
xapikey='YourXapikey'
117+
)
92118
self.assertEqual(422, result.message['status'])
93119
self.assertEqual("130", result.message['errorCode'])
94120
self.assertEqual("Reference Missing", result.message['message'])
@@ -104,7 +130,19 @@ def test_payments_details_success_mocked(self):
104130
"checkout/"
105131
"paymentsdetails"
106132
"-success.json")
133+
107134
result = self.adyen.checkout.payments_details(request)
135+
136+
self.adyen.client.http_client.request.assert_called_once_with(
137+
u'https://checkout-test.adyen.com/v64/payments/details',
138+
headers={},
139+
json={
140+
'paymentData': 'Hee57361f99....',
141+
u'merchantAccount': None,
142+
'details': {'MD': 'sdfsdfsdf...', 'PaRes': 'sdkfhskdjfsdf...'}
143+
},
144+
xapikey='YourXapikey'
145+
)
108146
self.assertEqual("8515232733321252", result.message['pspReference'])
109147
self.assertEqual("Authorised", result.message['resultCode'])
110148
self.assertEqual("true",

0 commit comments

Comments
 (0)