From 14dcd3b057d4b97615adef1195001fc5352403b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=9F=D0=BE?= =?UTF-8?q?=D0=BD=D0=BE=D0=BC=D0=B0=D1=80=D0=B5=D0=B2?= Date: Mon, 25 Mar 2024 23:09:06 +0000 Subject: [PATCH] Palmistry discount page --- .../palmistry/discount-screen/discount-screen.tsx | 9 +++++---- .../premium-bundle-screen/premium-bundle-screen.tsx | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/palmistry/discount-screen/discount-screen.tsx b/src/components/palmistry/discount-screen/discount-screen.tsx index 5906974..7986465 100644 --- a/src/components/palmistry/discount-screen/discount-screen.tsx +++ b/src/components/palmistry/discount-screen/discount-screen.tsx @@ -13,7 +13,8 @@ import { useAuth } from "@/auth"; import HeaderLogo from '@/components/palmistry/header-logo/header-logo'; import CheckoutForm from "@/components/PaymentPage/methods/Stripe/CheckoutForm"; -const currentProductId = "prod_PkXPacpzM8jSmE"; +const currentProductKey = "skip.trial.subscription.aura"; +const returnUrl = `${window.location.host}/palmistry/premium-bundle`; export default function DiscountScreen() { const navigate = useNavigate(); @@ -48,7 +49,7 @@ export default function DiscountScreen() { (async () => { const products = await api.getSinglePaymentProducts({ token }); - const product = products.find((product) => product.productId === currentProductId); + const product = products.find((product) => product.key === currentProductKey); if (product) { setProductId(product.productId); @@ -82,7 +83,7 @@ export default function DiscountScreen() { paymentInfo: { productId, }, - return_url: `${window.location.host}/palmistry/premium-bundle`, + return_url: returnUrl, }, }); @@ -149,7 +150,7 @@ export default function DiscountScreen() { {stripePromise && clientSecret && (
- + {isSuccess && ( diff --git a/src/components/palmistry/premium-bundle-screen/premium-bundle-screen.tsx b/src/components/palmistry/premium-bundle-screen/premium-bundle-screen.tsx index b2e85c6..f030979 100644 --- a/src/components/palmistry/premium-bundle-screen/premium-bundle-screen.tsx +++ b/src/components/palmistry/premium-bundle-screen/premium-bundle-screen.tsx @@ -12,7 +12,8 @@ import { useApi } from '@/api'; import { useAuth } from "@/auth"; import CheckoutForm from "@/components/PaymentPage/methods/Stripe/CheckoutForm"; -const currentProductId = "prod_PkXPacpzM8jSmE"; +const currentProductKey = "premium.bundle.aura"; +const returnUrl = window.location.host; export default function PremiumBundleScreen() { const navigate = useNavigate(); @@ -29,7 +30,7 @@ export default function PremiumBundleScreen() { (async () => { const products = await api.getSinglePaymentProducts({ token }); - const product = products.find((product) => product.productId === currentProductId); + const product = products.find((product) => product.key === currentProductKey); if (product) { setProductId(product.productId); @@ -63,7 +64,7 @@ export default function PremiumBundleScreen() { paymentInfo: { productId, }, - return_url: `${window.location.host}/palmistry/premium-bundle`, + return_url: returnUrl, }, }); @@ -215,7 +216,7 @@ export default function PremiumBundleScreen() { {stripePromise && clientSecret && (
- + {isSuccess && (