@@ -170,6 +128,7 @@ function PaymentModal({ activeSubscriptionPlan, noTrial, returnUrl }: IPaymentMo
Choose payment method
@@ -180,7 +139,8 @@ function PaymentModal({ activeSubscriptionPlan, noTrial, returnUrl }: IPaymentMo
You will be charged only{" "}
- ${getPriceFromTrial(activeSubPlan?.trial)} for your 3-day trial.
+ ${getPriceFromTrial(activeSubPlan?.trial)} for your 3-day
+ trial.
@@ -197,26 +157,22 @@ function PaymentModal({ activeSubscriptionPlan, noTrial, returnUrl }: IPaymentMo
{stripePromise && clientSecret && (
- {selectedPaymentMethod === EPaymentMethod.PAYPAL_OR_APPLE_PAY && (
+ {selectedPaymentMethod === EPaymentMethod.PAYMENT_BUTTONS && (
- {payPalSubPlan && (
-
- )}
- {!!errors.length &&
{errors}
}
)}
{selectedPaymentMethod === EPaymentMethod.CREDIT_CARD && (
-
+
)}
)}
diff --git a/src/components/pages/TrialPayment/components/PaymentModal/styles.module.css b/src/components/pages/TrialPayment/components/PaymentModal/styles.module.css
index 8cf491b..db76c7b 100644
--- a/src/components/pages/TrialPayment/components/PaymentModal/styles.module.css
+++ b/src/components/pages/TrialPayment/components/PaymentModal/styles.module.css
@@ -24,6 +24,9 @@
.payment-method-container {
width: 100%;
+ display: flex;
+ flex-direction: column;
+ gap: 24px;
}
.address {
@@ -41,4 +44,4 @@
.address {
color: gray;
font-size: 10px;
-}
\ No newline at end of file
+}
diff --git a/src/components/palmistry/step-subscription-plan/step-subscription-plan.tsx b/src/components/palmistry/step-subscription-plan/step-subscription-plan.tsx
index b8c99c1..d1f4de5 100644
--- a/src/components/palmistry/step-subscription-plan/step-subscription-plan.tsx
+++ b/src/components/palmistry/step-subscription-plan/step-subscription-plan.tsx
@@ -1,21 +1,21 @@
-import React from 'react';
+import React, { useMemo } from "react";
import { useDispatch } from "react-redux";
import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";
import { selectors } from "@/store";
-import useSteps, { Step } from '@/hooks/palmistry/use-steps';
-import Button from '@/components/palmistry/button/button';
-import EmailHeader from '@/components/palmistry/email-header/email-header';
+import useSteps, { Step } from "@/hooks/palmistry/use-steps";
+import Button from "@/components/palmistry/button/button";
+import EmailHeader from "@/components/palmistry/email-header/email-header";
import { ISubscriptionPlan } from "@/api/resources/SubscriptionPlans";
import { actions } from "@/store";
import { useApi } from "@/api";
-const bestPlanId = 'stripe.15';
+const bestPlanId = "stripe.15";
const getFormattedPrice = (plan: ISubscriptionPlan) => {
return (plan.trial!.price_cents / 100).toFixed(2);
-}
+};
export default function StepSubscriptionPlan() {
const steps = useSteps();
@@ -23,11 +23,14 @@ export default function StepSubscriptionPlan() {
const api = useApi();
const { i18n } = useTranslation();
const activeSubPlanFromStore = useSelector(selectors.selectActiveSubPlan);
+ const allowedPlans = useMemo(() => ["stripe.37"], []);
const storedEmail = steps.getStoredValue(Step.Email);
- const [subscriptionPlan, setSubscriptionPlan] = React.useState('');
- const [subscriptionPlans, setSubscriptionPlans] = React.useState
([]);
+ const [subscriptionPlan, setSubscriptionPlan] = React.useState("");
+ const [subscriptionPlans, setSubscriptionPlans] = React.useState<
+ ISubscriptionPlan[]
+ >([]);
const [email, setEmail] = React.useState(steps.getStoredValue(Step.Email));
const locale = i18n.language;
@@ -42,7 +45,10 @@ export default function StepSubscriptionPlan() {
(async () => {
const { sub_plans } = await api.getSubscriptionPlans({ locale });
const plans = sub_plans
- .filter((plan: ISubscriptionPlan) => plan.provider === "stripe")
+ .filter(
+ (plan: ISubscriptionPlan) =>
+ plan.provider === "stripe" && !plan.name.includes("(test)")
+ )
.sort((a, b) => {
if (!a.trial || !b.trial) {
return 0;
@@ -55,13 +61,19 @@ export default function StepSubscriptionPlan() {
}
return 0;
});
- setSubscriptionPlans(plans.filter((plan) => plan.trial?.price_cents));
+ setSubscriptionPlans(
+ plans.filter(
+ (plan) => plan.trial?.price_cents || allowedPlans.includes(plan.id)
+ )
+ );
})();
- }, [api, locale]);
+ }, [allowedPlans, api, locale]);
React.useEffect(() => {
if (subscriptionPlan) {
- const targetSubPlan = subscriptionPlans.find((sub_plan) => sub_plan.id === subscriptionPlan);
+ const targetSubPlan = subscriptionPlans.find(
+ (sub_plan) => sub_plan.id === subscriptionPlan
+ );
if (targetSubPlan) {
dispatch(actions.payment.update({ activeSubPlan: targetSubPlan }));
@@ -70,7 +82,7 @@ export default function StepSubscriptionPlan() {
}, [subscriptionPlan]);
React.useEffect(() => {
- setEmail(storedEmail || '');
+ setEmail(storedEmail || "");
}, [storedEmail]);
const onNext = () => {
@@ -80,15 +92,21 @@ export default function StepSubscriptionPlan() {
return (
<>
-
+
- We've helped millions of people to reveal the destiny of their love life and what the future holds for them and
- their families.
+ We've helped millions of people to reveal the destiny of their love life
+ and what the future holds for them and their families.
-
+
(
setSubscriptionPlan(plan.id)}
>
${getFormattedPrice(plan)}
@@ -139,11 +161,23 @@ export default function StepSubscriptionPlan() {
))}
-
- It costs us $13.21 to compensate our AURA employees for the trial, but please choose the amount you are comfortable with.
+
+ It costs us $13.21 to compensate our AURA employees for the trial, but
+ please choose the amount you are comfortable with.
-
+
Continue
>
diff --git a/src/components/ui/PaymentMethodsButtons/PayPayOrApplePay/index.tsx b/src/components/ui/PaymentMethodsButtons/PaymentButtons/index.tsx
similarity index 58%
rename from src/components/ui/PaymentMethodsButtons/PayPayOrApplePay/index.tsx
rename to src/components/ui/PaymentMethodsButtons/PaymentButtons/index.tsx
index 9b9b4b1..dd1721a 100644
--- a/src/components/ui/PaymentMethodsButtons/PayPayOrApplePay/index.tsx
+++ b/src/components/ui/PaymentMethodsButtons/PaymentButtons/index.tsx
@@ -1,10 +1,9 @@
import styles from "./styles.module.css";
-function PayPalOrApplePay() {
+function PaymentButtons() {
return
-
;
}
-export default PayPalOrApplePay;
+export default PaymentButtons;
diff --git a/src/components/ui/PaymentMethodsButtons/PayPayOrApplePay/styles.module.css b/src/components/ui/PaymentMethodsButtons/PaymentButtons/styles.module.css
similarity index 100%
rename from src/components/ui/PaymentMethodsButtons/PayPayOrApplePay/styles.module.css
rename to src/components/ui/PaymentMethodsButtons/PaymentButtons/styles.module.css
diff --git a/src/data/paymentMethods.tsx b/src/data/paymentMethods.tsx
index bafe93a..5428dc2 100644
--- a/src/data/paymentMethods.tsx
+++ b/src/data/paymentMethods.tsx
@@ -1,20 +1,20 @@
import CreditCard from "@/components/ui/PaymentMethodsButtons/CreditCard";
-import PayPalOrApplePay from "@/components/ui/PaymentMethodsButtons/PayPayOrApplePay";
+import PaymentButtons from "@/components/ui/PaymentMethodsButtons/PaymentButtons";
export enum EPaymentMethod {
CREDIT_CARD = "card",
- PAYPAL_OR_APPLE_PAY = "payPalOrApplePay",
+ PAYMENT_BUTTONS = "paymentButtons",
}
-interface IPaymentMethod {
+export interface IPaymentMethod {
id: EPaymentMethod;
component: JSX.Element;
}
export const paymentMethods: IPaymentMethod[] = [
{
- id: EPaymentMethod.PAYPAL_OR_APPLE_PAY,
- component: ,
+ id: EPaymentMethod.PAYMENT_BUTTONS,
+ component: ,
},
{
id: EPaymentMethod.CREDIT_CARD,