From bb86f1b8e642fde129d5523c722a8de98fe140a0 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 8 Jun 2022 16:01:38 +0300 Subject: [PATCH] Throw on createOrder failure to stop PayPal from attempting to continue --- .../resources/js/modules/ActionHandler/CheckoutActionHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js index bc7a90b4a..733b5e339 100644 --- a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js +++ b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js @@ -61,7 +61,7 @@ class CheckoutActionHandler { } } - return; + throw new Error(data.data.message); } const input = document.createElement('input'); input.setAttribute('type', 'hidden');