This commit is contained in:
Kenneth Jannette
2024-01-28 23:19:06 -06:00
parent b06aa1f053
commit 926b69695f
4 changed files with 56 additions and 28 deletions

View File

@@ -216,29 +216,14 @@ const SignupPage = () => {
if (isBusy) {
return;
}
/*
const dataValues = validateUserData();
if (dataValues === null) {
return;
}
/*
const userDataValues = {
barNumber: "232323",
city: "broolyn",
email: "j@s.com",
firm: "asdf",
firstName: "ghghg",
lastName: "hhhhh",
password: "123344556",
practiceArea: "dfdfdf",
state: "New York",
streetAddress: "123 Main",
telephone: "(313) 555-5555",
zipCode: "12345",
};
*/
saveLeadData(dataValues);
*/
setShowSelectPlan(!showSelectPlan);
};
@@ -260,13 +245,16 @@ const SignupPage = () => {
paymentDataValues,
customerDataValues
) {
console.log(
"~~~~~~~~~~~~~~~~~~~~_______-~~~~handleStripeAuthorization fired"
);
const additionalAccounts = numberOfAccountsToAdd
? numberOfAccountsToAdd
: 0;
let error = false;
let subscriptionId = null;
let customerId = null;
console.log("~~~~~~~~~~~~~~~~~~~~~~~~handleStripeAuthorization fired");
const token = await stripe.tokens.create({
card: {
number: paymentDataValues.cardNumber,
@@ -279,16 +267,15 @@ const SignupPage = () => {
paymentDataValues.cardLastName,
},
});
const type = selectedPlan[0].value ? selectedPlan[0].value : null;
try {
console.log("got to create-subscription try block");
let response = await fetch(`${apiUrl}/create-subscription`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
type: selectedPlan,
planType: type,
additionalAccounts: additionalAccounts,
isAnnual: isAnnual,
customerData: {
@@ -325,18 +312,37 @@ const SignupPage = () => {
const handleSignup = async (totalDue) => {
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>handleSignup fired");
console.log("totalDue", totalDue);
const paymentDataValues = validatePaymentData();
if (paymentDataValues === null) {
return;
}
let dataValues = validateUserData();
/* let dataValues = validateUserData();
if (dataValues === null) {
return;
}
console.log("dataValues in handleSignup", dataValues);
*/
const id = uuidv4();
const email = `${id}@jim.com`;
let dataValues = {
firstName: "fffff",
lastName: "ffff",
firm: "form",
telephone: "(313) 333-3333",
streetAddress: "123 main",
city: "new york",
state: "New York",
zipCode: "10122",
barNumber: "2343434",
practiceArea: "3df",
email: email,
password: "stingPrug1",
confirmPassword: "stingPrug1",
};
const planType = determinePlan(isAnnual, activeRadioOption);
console.log(planType);
setIsBusy(true);
if (paymentDataValues && dataValues) {
@@ -369,6 +375,7 @@ const SignupPage = () => {
}
} catch (error) {
setIsBusy(false);
console.log("-------->error", error);
setNotice(
error.message || "Sorry, something went wrong. Please try again."
);
@@ -625,4 +632,24 @@ const SignupPage = () => {
};
export default SignupPage;
//
/*
const userDataValues = {
barNumber: "232323",
city: "broolyn",
email: "j@s.com",
firm: "asdf",
firstName: "ghghg",
lastName: "hhhhh",
password: "123344556",
practiceArea: "dfdfdf",
state: "New York",
streetAddress: "123 Main",
telephone: "(313) 555-5555",
zipCode: "12345",
};
*/