more
This commit is contained in:
@@ -112,7 +112,7 @@ const SignupPage = () => {
|
|||||||
|
|
||||||
const handleProceedToPayment = (e) => {
|
const handleProceedToPayment = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
/*
|
|
||||||
if (isBusy) {
|
if (isBusy) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,6 @@ const SignupPage = () => {
|
|||||||
if (dataValues === null) {
|
if (dataValues === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
setShowPaymentModal(true);
|
setShowPaymentModal(true);
|
||||||
};
|
};
|
||||||
@@ -137,7 +136,29 @@ const SignupPage = () => {
|
|||||||
if (paymentDataValues === null) {
|
if (paymentDataValues === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("paymentDataValues", paymentDataValues);
|
const dataValues = validateData();
|
||||||
|
if (dataValues === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIsBusy(true);
|
||||||
|
const paymentSuccess = handleStripeAuthorization(paymentDataValues);
|
||||||
|
if (paymentSuccess) {
|
||||||
|
try {
|
||||||
|
const userCredential = await createUserWithEmailAndPassword(
|
||||||
|
auth,
|
||||||
|
dataValues.email,
|
||||||
|
dataValues.password
|
||||||
|
);
|
||||||
|
const user = userCredential.user;
|
||||||
|
await saveUserData(user.uid, dataValues);
|
||||||
|
navigate("/");
|
||||||
|
} catch (error) {
|
||||||
|
setIsBusy(false);
|
||||||
|
setNotice(
|
||||||
|
error.message || "Sorry, something went wrong. Please try again."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user