From db3a65ddeff008a0eaf4616d59d7d041e37f18f3 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Tue, 14 May 2024 15:30:14 +0400 Subject: [PATCH] Redirect to order received --- .../js/modules/OnApproveHandler/onApproveForContinue.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForContinue.js b/modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForContinue.js index 2068563a7..c853b7575 100644 --- a/modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForContinue.js +++ b/modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForContinue.js @@ -20,7 +20,11 @@ const onApprove = (context, errorHandler) => { errorHandler.genericError(); }); } - location.href = context.config.redirect; + + let orderReceivedUrl = data.data?.order_received_url + + location.href = orderReceivedUrl ? orderReceivedUrl : context.config.redirect; + }); }