From 28223762ebffa94b22afb22a28481f29e4722411 Mon Sep 17 00:00:00 2001 From: rizdaprasetya Date: Wed, 1 Sep 2021 11:39:41 +0700 Subject: [PATCH] remove jquery dependency from payment page js - to avoid edge-case issue: when merchant use unknown 3rd party asset optimizer plugin, on payment page, jQuery may be loaded late/randomly (race condition). it can cause jQuery is undefined that prevent the payment js to run. --- public/js/midtrans-payment-page-main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/js/midtrans-payment-page-main.js b/public/js/midtrans-payment-page-main.js index 31caaf2..bedd8d7 100644 --- a/public/js/midtrans-payment-page-main.js +++ b/public/js/midtrans-payment-page-main.js @@ -1,6 +1,6 @@ // wc_midtrans var is passed from payment-page backend via inline script. -;(function( $, window, document ) { +;(function( window, document ) { var payButton = document.getElementById("pay-button"); /** @@ -242,5 +242,4 @@ handlePayAction(); payButton.innerHTML = "Proceed To Payment"; -})( jQuery, window, document ); -// well jQuery is not actually used, just for formality \ No newline at end of file +})( window, document ); \ No newline at end of file