diff --git a/Adyen/services/payments/modifications_api.py b/Adyen/services/payments/modifications_api.py index 06281be9..af9b100f 100644 --- a/Adyen/services/payments/modifications_api.py +++ b/Adyen/services/payments/modifications_api.py @@ -17,80 +17,65 @@ def adjust_authorisation(self, request, idempotency_key=None, **kwargs): """ Change the authorised amount """ - endpoint = self.baseUrl + "/adjustAuthorisation" + endpoint = self.baseUrl + f"/adjustAuthorisation" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def cancel(self, request, idempotency_key=None, **kwargs): """ Cancel an authorisation """ - endpoint = self.baseUrl + "/cancel" + endpoint = self.baseUrl + f"/cancel" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def cancel_or_refund(self, request, idempotency_key=None, **kwargs): """ Cancel or refund a payment """ - endpoint = self.baseUrl + "/cancelOrRefund" + endpoint = self.baseUrl + f"/cancelOrRefund" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def capture(self, request, idempotency_key=None, **kwargs): """ Capture an authorisation """ - endpoint = self.baseUrl + "/capture" + endpoint = self.baseUrl + f"/capture" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def donate(self, request, idempotency_key=None, **kwargs): """ Create a donation - Deprecated + Deprecated """ - endpoint = self.baseUrl + "/donate" + endpoint = self.baseUrl + f"/donate" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def refund(self, request, idempotency_key=None, **kwargs): """ Refund a captured payment """ - endpoint = self.baseUrl + "/refund" + endpoint = self.baseUrl + f"/refund" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def technical_cancel(self, request, idempotency_key=None, **kwargs): """ Cancel an authorisation using your reference """ - endpoint = self.baseUrl + "/technicalCancel" + endpoint = self.baseUrl + f"/technicalCancel" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def void_pending_refund(self, request, idempotency_key=None, **kwargs): """ Cancel an in-person refund """ - endpoint = self.baseUrl + "/voidPendingRefund" + endpoint = self.baseUrl + f"/voidPendingRefund" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) + diff --git a/Adyen/services/payments/payments_api.py b/Adyen/services/payments/payments_api.py index 8831e444..b7fe62b1 100644 --- a/Adyen/services/payments/payments_api.py +++ b/Adyen/services/payments/payments_api.py @@ -17,48 +17,39 @@ def authorise(self, request, idempotency_key=None, **kwargs): """ Create an authorisation """ - endpoint = self.baseUrl + "/authorise" + endpoint = self.baseUrl + f"/authorise" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def authorise3d(self, request, idempotency_key=None, **kwargs): """ Complete a 3DS authorisation """ - endpoint = self.baseUrl + "/authorise3d" + endpoint = self.baseUrl + f"/authorise3d" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def authorise3ds2(self, request, idempotency_key=None, **kwargs): """ Complete a 3DS2 authorisation """ - endpoint = self.baseUrl + "/authorise3ds2" + endpoint = self.baseUrl + f"/authorise3ds2" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def get_authentication_result(self, request, idempotency_key=None, **kwargs): """ Get the 3DS authentication result """ - endpoint = self.baseUrl + "/getAuthenticationResult" + endpoint = self.baseUrl + f"/getAuthenticationResult" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) def retrieve3ds2_result(self, request, idempotency_key=None, **kwargs): """ Get the 3DS2 authentication result """ - endpoint = self.baseUrl + "/retrieve3ds2Result" + endpoint = self.baseUrl + f"/retrieve3ds2Result" method = "POST" - return self.client.call_adyen_api( - request, self.service, method, endpoint, idempotency_key, **kwargs - ) + return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) +