From 840c168ec30acc194fbf78d7b8644642c6e1089a Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Fri, 23 Feb 2024 23:15:05 -0600 Subject: [PATCH] more --- src/Components/Modals/PaymentModal.js | 35 ++++++++++++------------- src/Components/SignupPage/SignupPage.js | 5 ++-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/Components/Modals/PaymentModal.js b/src/Components/Modals/PaymentModal.js index 2a466af..cb7ddf3 100644 --- a/src/Components/Modals/PaymentModal.js +++ b/src/Components/Modals/PaymentModal.js @@ -44,13 +44,24 @@ const PaymentModal = ({ (selectedPlan[0]?.value === "seniorPartner" && numberOfAccountsToAdd > 0); const planName = selectedPlan[0].name ? selectedPlan[0].name : null; - const billingPeriod = isAnnual ? "Annually" : "Monthly"; - const amountToday = isAnnual - ? annualSubscriptionPriceToday - : monthlySubscriptionPriceToday; + const planValue = selectedPlan[0].value ? selectedPlan[0].value : null; + const billingPeriod = + planValue === "ofCounsel" + ? "Single Purchase" + : isAnnual + ? "Annually" + : "Monthly"; + const amountToday = + planValue === "ofCounsel" + ? 59 + : isAnnual + ? annualSubscriptionPriceToday + : monthlySubscriptionPriceToday; - const totalToday = amountToday + extraAccountsPrice; + const totalToday = + planValue === "ofCounsel" ? 59 : amountToday + extraAccountsPrice; + const isCounsel = planValue === "ofCounsel" ? true : false; const handleSignupClick = () => { //clear fields handleSignup(); @@ -95,7 +106,7 @@ const PaymentModal = ({
Total today:
${totalToday}
- {isAnnual ? ( + {isAnnual && !isCounsel ? (
@@ -171,15 +182,3 @@ const PaymentModal = ({ }; export default PaymentModal; - -/* - const tempExtraAccountsPrice = isAnnual - ? additionalAccountsAnnualPriceToday - : additionalAccountsMonthlyPriceToday; - - const extraAccountsPrice = - tempExtraAccountsPrice === NaN || tempExtraAccountsPrice === undefined - ? 0 - : 0; - - */ diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index d61a603..b5e7c0e 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -424,7 +424,7 @@ const SignupPage = () => { paymentDataValues, dataValues ); - console.log("9====> ~ ~ ~ ~ data", data); + console.log("data returned from handleStipeAuth", data); const customerId = data?.data?.customerId; const subscriptionCreated = data?.data?.subscriptionCreated; const subscriptionPeriodStart = data?.data?.subscriptionPeriodStart; @@ -455,12 +455,11 @@ const SignupPage = () => { subscriptionId, isPromotionalMebership ); - setIsBusy(false); navigate("/dashboard"); } } catch (error) { - console.log("Error handling request", error, error.message); + console.log("Error handling request", error); setIsBusy(false); setNotice("Sorry, something went wrong. Please try again."); }