Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add payment_id to redirect url in adyen webhooks
IKarbowiakb54408f49c9c
diff --git a/saleor/payment/gateways/adyen/tests/test_webhook.py b/saleor/payment/gateways/adyen/tests/test_webhook.pyindex 4ea5f1ba81..6e4af466c0 100644--- a/saleor/payment/gateways/adyen/tests/test_webhook.py+++ b/saleor/payment/gateways/adyen/tests/test_webhook.py@@ -1,6 +1,7 @@import jsonfrom decimal import Decimalfrom unittest import mock+from urllib.parse import quote_plusimport grapheneimport pytest@@ -631,8 +632,9 @@ def test_handle_additional_actions(payment_adyen_for_checkout):# thenassert response.status_code == 302- assert f"checkout={checkout_id}" in response.url+ assert f"checkout={quote_plus(checkout_id)}" in response.urlassert f"resultCode={message['resultCode']}" in response.url+ assert f"payment={quote_plus(payment_id)}" in response.urldef test_handle_additional_actions_more_action_required(payment_adyen_for_checkout):@@ -673,7 +675,8 @@ def test_handle_additional_actions_more_action_required(payment_adyen_for_checkoassert f"paymentData={message['action']['paymentData']}" in response.urlassert f"paymentMethodType={message['action']['paymentMethodType']}" in response.urlassert f"type={message['action']['type']}" in response.url- assert f"checkout={checkout_id}" in response.url+ assert f"checkout={quote_plus(checkout_id)}" in response.url+ assert f"payment={quote_plus(payment_id)}" in response.urldef test_handle_additional_actions_payment_does_not_exist(payment_adyen_for_checkout):diff --git a/saleor/payment/gateways/adyen/webhooks.py b/saleor/payment/gateways/adyen/webhooks.pyindex 498c1a61ab..b07b3db6aa 100644--- a/saleor/payment/gateways/adyen/webhooks.py+++ b/saleor/payment/gateways/adyen/webhooks.py@@ -522,6 +522,7 @@ def handle_additional_actions(request: WSGIRequest, payment_details: Callable):params = {"checkout": checkout_id,+ "payment": payment_id,"resultCode": result.message["resultCode"],}