@@ -96,7 +96,7 @@ def test_payments_error_mocked(self):
9696 self .adyen .client .http_client .request .assert_called_once_with (
9797 'POST' ,
9898 f'{ self .baseUrl } /payments' ,
99- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
99+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
100100 json = {
101101 'returnUrl' : 'https://your-company.com/...' ,
102102 'reference' : '54431' ,
@@ -134,7 +134,7 @@ def test_payments_details_success_mocked(self):
134134 self .adyen .client .http_client .request .assert_called_once_with (
135135 'POST' ,
136136 f'{ self .baseUrl } /payments/details' ,
137- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
137+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
138138 json = {
139139 'paymentData' : 'Hee57361f99....' ,
140140 'details' : {'MD' : 'sdfsdfsdf...' , 'PaRes' : 'sdkfhskdjfsdf...' }
@@ -323,7 +323,7 @@ def test_payments_capture_success_mocked(self):
323323 f'{ self .baseUrl } /payments/{ psp_reference } /captures' ,
324324 json = request ,
325325 xapikey = 'YourXapikey' ,
326- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
326+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
327327 )
328328 self .assertEqual (psp_reference , result .message ["paymentPspReference" ])
329329 self .assertIsNotNone (result .message ["pspReference" ])
@@ -365,7 +365,7 @@ def test_orders_success(self):
365365 f'{ self .baseUrl } /orders' ,
366366 json = request ,
367367 xapikey = 'YourXapikey' ,
368- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
368+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
369369
370370 )
371371 self .assertEqual ("8515930288670953" , result .message ['pspReference' ])
@@ -387,7 +387,7 @@ def test_orders_cancel_success(self):
387387 f'{ self .baseUrl } /orders/cancel' ,
388388 json = request ,
389389 xapikey = 'YourXapikey' ,
390- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
390+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
391391 )
392392 self .assertEqual ("8515931182066678" , result .message ['pspReference' ])
393393 self .assertEqual ("Received" , result .message ['resultCode' ])
@@ -406,7 +406,7 @@ def test_paymentmethods_balance_success(self):
406406 f'{ self .baseUrl } /paymentMethods/balance' ,
407407 json = request ,
408408 xapikey = 'YourXapikey' ,
409- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
409+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
410410 )
411411 self .assertEqual ("851611111111713K" , result .message ['pspReference' ])
412412 self .assertEqual ("Success" , result .message ['resultCode' ])
@@ -442,7 +442,7 @@ def test_sessions_error(self):
442442 f'{ self .baseUrl } /sessions' ,
443443 json = {'merchantAccount' : 'YourMerchantAccount' },
444444 xapikey = 'YourXapikey' ,
445- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
445+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
446446 )
447447 self .assertEqual (422 , result .message ['status' ])
448448 self .assertEqual ("130" , result .message ['errorCode' ])
@@ -487,7 +487,7 @@ def test_payment_link(self):
487487 self .adyen .client .http_client .request .assert_called_once_with (
488488 'POST' ,
489489 f'{ self .baseUrl } /paymentLinks' ,
490- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
490+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
491491 xapikey = 'YourXapikey' ,
492492 json = request
493493 )
@@ -504,7 +504,7 @@ def test_get_payment_link(self):
504504 self .adyen .client .http_client .request .assert_called_once_with (
505505 'GET' ,
506506 f'{ self .baseUrl } /paymentLinks/{ id } ' ,
507- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
507+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
508508 xapikey = "YourXapikey" ,
509509 json = None
510510 )
@@ -523,7 +523,7 @@ def test_update_payment_link(self):
523523 self .adyen .client .http_client .request .assert_called_once_with (
524524 'PATCH' ,
525525 f'{ self .baseUrl } /paymentLinks/{ id } ' ,
526- headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION },
526+ headers = {'adyen-library-name' : 'adyen-python-api-library' , 'adyen-library-version' : settings .LIB_VERSION , 'User-Agent' : 'adyen-python-api-library/' + settings . LIB_VERSION },
527527 xapikey = "YourXapikey" ,
528528 json = request
529529 )
0 commit comments