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);
};
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 [cardName, setCardName] = useState("");
const [cardSecNumber, setCardSecNumber] = useState("");
@@ -105,10 +112,19 @@ const SignupPage = () => {
}
}
async function handleStripePaymentAuthorization(paymentDataValues) {
console.log(paymentDataValues);
}
const handleSignup = async (e) => {
console.log("handleSignup");
/*
e.preventDefault();
const paymentDataValues = validatePaymentData();
if (paymentDataValues === null) {
return;
}
/*
const paymentSuccess = handleStripePaymentAuthorization(paymentDataValues);
if (paymentSuccess) {
if (isBusy) {
return;
}
@@ -129,16 +145,16 @@ const SignupPage = () => {
error.message || "Sorry, something went wrong. Please try again."
);
}
}
*/
};
const handleProceed = () => {
/*
const dataValues = validateData();
if (dataValues === null) {
return;
}
*/
setShowPaymentModal(true);
};