This commit is contained in:
Kenneth Jannette
2024-01-19 15:43:03 -06:00
parent 21cf110cf2
commit 1c67511871

View File

@@ -58,6 +58,13 @@ const SignupPage = () => {
return hasErrors ? null : objectMap(({ value }) => value, newData); return hasErrors ? null : objectMap(({ value }) => value, newData);
}; };
const validatePaymentData = () => {
const newData = getValidatedFormData(data, signupfields);
const hasErrors = isFormDataHasErrors(newData);
setPaymentdata(newData);
return hasErrors ? null : objectMap(({ value }) => value, newData);
};
const [cardNumber, setCardNumber] = useState(""); const [cardNumber, setCardNumber] = useState("");
const [cardName, setCardName] = useState(""); const [cardName, setCardName] = useState("");
const [cardSecNumber, setCardSecNumber] = useState(""); const [cardSecNumber, setCardSecNumber] = useState("");
@@ -105,10 +112,19 @@ const SignupPage = () => {
} }
} }
async function handleStripePaymentAuthorization(paymentDataValues) {
console.log(paymentDataValues);
}
const handleSignup = async (e) => { const handleSignup = async (e) => {
console.log("handleSignup");
/*
e.preventDefault(); e.preventDefault();
const paymentDataValues = validatePaymentData();
if (paymentDataValues === null) {
return;
}
/*
const paymentSuccess = handleStripePaymentAuthorization(paymentDataValues);
if (paymentSuccess) {
if (isBusy) { if (isBusy) {
return; return;
} }
@@ -129,16 +145,16 @@ const SignupPage = () => {
error.message || "Sorry, something went wrong. Please try again." error.message || "Sorry, something went wrong. Please try again."
); );
} }
}
*/ */
}; };
const handleProceed = () => { const handleProceed = () => {
/*
const dataValues = validateData(); const dataValues = validateData();
if (dataValues === null) { if (dataValues === null) {
return; return;
} }
*/
setShowPaymentModal(true); setShowPaymentModal(true);
}; };