@@ -96,15 +96,9 @@ def test_payments_error_mocked(self):
9696 self .adyen .client .http_client .request .assert_called_once_with (
9797 'POST' ,
9898 'https://checkout-test.adyen.com/{}/payments' .format (self .checkout_version ),
99- headers = {},
99+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
100100 json = {
101101 'returnUrl' : 'https://your-company.com/...' ,
102- u'applicationInfo' : {
103- u'adyenLibrary' : {
104- u'version' : f"{ self .lib_version } " ,
105- u'name' : 'adyen-python-api-library'
106- }
107- },
108102 'reference' : '54431' ,
109103 'merchantAccount' : 'YourMerchantAccount' ,
110104 'amount' : {'currency' : 'EUR' , 'value' : '100000' },
@@ -115,7 +109,8 @@ def test_payments_error_mocked(self):
115109 'expiryMonth' : '08' ,
116110 'type' : 'scheme' ,
117111 'cvc' : '737'
118- }
112+ },
113+ 'applicationInfo' : {'adyenLibrary' : {'name' : 'adyen-python-api-library' , 'version' : settings .LIB_VERSION }}
119114 },
120115 xapikey = 'YourXapikey'
121116 )
@@ -140,7 +135,7 @@ def test_payments_details_success_mocked(self):
140135 self .adyen .client .http_client .request .assert_called_once_with (
141136 'POST' ,
142137 u'https://checkout-test.adyen.com/{}/payments/details' .format (self .checkout_version ),
143- headers = {},
138+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
144139 json = {
145140 'paymentData' : 'Hee57361f99....' ,
146141 'details' : {'MD' : 'sdfsdfsdf...' , 'PaRes' : 'sdkfhskdjfsdf...' }
@@ -398,7 +393,7 @@ def test_payments_capture_success_mocked(self):
398393 f'https://checkout-test.adyen.com/{ self .checkout_version } /payments/{ psp_reference } /captures' ,
399394 json = request ,
400395 xapikey = 'YourXapikey' ,
401- headers = {}
396+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
402397 )
403398 self .assertEqual (psp_reference , result .message ["paymentPspReference" ])
404399 self .assertIsNotNone (result .message ["pspReference" ])
@@ -440,7 +435,8 @@ def test_orders_success(self):
440435 f'https://checkout-test.adyen.com/{ self .checkout_version } /orders' ,
441436 json = request ,
442437 xapikey = 'YourXapikey' ,
443- headers = {}
438+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
439+
444440 )
445441 self .assertEqual ("8515930288670953" , result .message ['pspReference' ])
446442 self .assertEqual ("Success" , result .message ['resultCode' ])
@@ -461,7 +457,7 @@ def test_orders_cancel_success(self):
461457 f'https://checkout-test.adyen.com/{ self .checkout_version } /orders/cancel' ,
462458 json = request ,
463459 xapikey = 'YourXapikey' ,
464- headers = {}
460+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
465461 )
466462 self .assertEqual ("8515931182066678" , result .message ['pspReference' ])
467463 self .assertEqual ("Received" , result .message ['resultCode' ])
@@ -480,7 +476,7 @@ def test_paymentmethods_balance_success(self):
480476 f'https://checkout-test.adyen.com/{ self .checkout_version } /paymentMethods/balance' ,
481477 json = request ,
482478 xapikey = 'YourXapikey' ,
483- headers = {}
479+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
484480 )
485481 self .assertEqual ("851611111111713K" , result .message ['pspReference' ])
486482 self .assertEqual ("Success" , result .message ['resultCode' ])
@@ -514,9 +510,10 @@ def test_sessions_error(self):
514510 self .adyen .client .http_client .request .assert_called_once_with (
515511 'POST' ,
516512 f'https://checkout-test.adyen.com/{ self .checkout_version } /sessions' ,
517- json = {'merchantAccount' : 'YourMerchantAccount' , 'applicationInfo' : {'adyenLibrary' : {'name' : 'adyen-python-api-library' , 'version' : '7.1.1' }}},
513+ json = {'merchantAccount' : 'YourMerchantAccount' ,
514+ 'applicationInfo' : {'adyenLibrary' : {'name' : 'adyen-python-api-library' , 'version' : settings .LIB_VERSION }}},
518515 xapikey = 'YourXapikey' ,
519- headers = {}
516+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
520517 )
521518 self .assertEqual (422 , result .message ['status' ])
522519 self .assertEqual ("130" , result .message ['errorCode' ])
@@ -561,7 +558,7 @@ def test_payment_link(self):
561558 self .adyen .client .http_client .request .assert_called_once_with (
562559 'POST' ,
563560 f'https://checkout-test.adyen.com/{ self .checkout_version } /paymentLinks' ,
564- headers = {},
561+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
565562 xapikey = 'YourXapikey' ,
566563 json = request
567564 )
@@ -578,7 +575,7 @@ def test_get_payment_link(self):
578575 self .adyen .client .http_client .request .assert_called_once_with (
579576 'GET' ,
580577 f'https://checkout-test.adyen.com/{ self .checkout_version } /paymentLinks/{ id } ' ,
581- headers = {},
578+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
582579 xapikey = "YourXapikey" ,
583580 json = None
584581 )
@@ -597,7 +594,7 @@ def test_update_payment_link(self):
597594 self .adyen .client .http_client .request .assert_called_once_with (
598595 'PATCH' ,
599596 f'https://checkout-test.adyen.com/{ self .checkout_version } /paymentLinks/{ id } ' ,
600- headers = {},
597+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings . LIB_VERSION },
601598 xapikey = "YourXapikey" ,
602599 json = request
603600 )
0 commit comments