From 3a4407d37323dafbecc16a4380d8a9cb0f4bf435 Mon Sep 17 00:00:00 2001 From: Alchie Tagudin Date: Wed, 10 Sep 2025 03:13:11 +0800 Subject: [PATCH] feat: add payment authorization checkbox to donation form --- src/components/DonationFormSection/OnlineDonationForm.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/DonationFormSection/OnlineDonationForm.tsx b/src/components/DonationFormSection/OnlineDonationForm.tsx index 777b814..e9a7ea7 100644 --- a/src/components/DonationFormSection/OnlineDonationForm.tsx +++ b/src/components/DonationFormSection/OnlineDonationForm.tsx @@ -5,6 +5,7 @@ import React, { useState } from "react"; const OnlineDonationForm: React.FC = () => { const [loading, setLoading] = useState(false); + const [checked, setChecked] = useState(false); const [amount, setAmount] = useState(""); const [formData, setFormData] = useState({ fullName: "", @@ -83,7 +84,7 @@ const OnlineDonationForm: React.FC = () => { ); }; - const isDisabled = !isFormComplete() || loading; + const isDisabled = !isFormComplete() || loading || !checked; return (
@@ -140,7 +141,10 @@ const OnlineDonationForm: React.FC = () => { required />
- +
+ setChecked(!checked)} disabled={loading || !amount} /> + By clicking the button below, you authorize us and our payment partner (Xendit) to charge your selected payment method for the donation amount you selected above on a one-time basis only. Payments already made are non-refundable. +