From 78bcbd1bb114b1e5ba4b32640d2c65d6f3f0f416 Mon Sep 17 00:00:00 2001
From: bird <20701908+bir-d@users.noreply.github.com>
Date: Thu, 11 May 2023 16:53:33 +0800
Subject: [PATCH] fix: only lock payment button once client side error checking
 passes

---
 src/templates/payment_form.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/templates/payment_form.html b/src/templates/payment_form.html
index 489042e..19732a0 100644
--- a/src/templates/payment_form.html
+++ b/src/templates/payment_form.html
@@ -125,9 +125,9 @@ document.addEventListener('DOMContentLoaded', async function() {
 
     async function handlePaymentMethodSubmission(event, paymentMethod, shouldVerify = true) {
         event.preventDefault();
+        const token = await tokenize(paymentMethod);
         cardButton.disabled = true;
         cardButton.innerText = "Processing...";
-        const token = await tokenize(paymentMethod);
 
         let verificationToken;
         if (shouldVerify) {
-- 
GitLab