Palmistry discount page
This commit is contained in:
parent
ba080d3d4e
commit
14dcd3b057
@ -13,7 +13,8 @@ import { useAuth } from "@/auth";
|
|||||||
import HeaderLogo from '@/components/palmistry/header-logo/header-logo';
|
import HeaderLogo from '@/components/palmistry/header-logo/header-logo';
|
||||||
import CheckoutForm from "@/components/PaymentPage/methods/Stripe/CheckoutForm";
|
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() {
|
export default function DiscountScreen() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -48,7 +49,7 @@ export default function DiscountScreen() {
|
|||||||
(async () => {
|
(async () => {
|
||||||
const products = await api.getSinglePaymentProducts({ token });
|
const products = await api.getSinglePaymentProducts({ token });
|
||||||
|
|
||||||
const product = products.find((product) => product.productId === currentProductId);
|
const product = products.find((product) => product.key === currentProductKey);
|
||||||
|
|
||||||
if (product) {
|
if (product) {
|
||||||
setProductId(product.productId);
|
setProductId(product.productId);
|
||||||
@ -82,7 +83,7 @@ export default function DiscountScreen() {
|
|||||||
paymentInfo: {
|
paymentInfo: {
|
||||||
productId,
|
productId,
|
||||||
},
|
},
|
||||||
return_url: `${window.location.host}/palmistry/premium-bundle`,
|
return_url: returnUrl,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -149,7 +150,7 @@ export default function DiscountScreen() {
|
|||||||
{stripePromise && clientSecret && (
|
{stripePromise && clientSecret && (
|
||||||
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
|
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
|
||||||
<Elements stripe={stripePromise} options={{ clientSecret }}>
|
<Elements stripe={stripePromise} options={{ clientSecret }}>
|
||||||
<CheckoutForm returnUrl={`${window.location.host}/palmistry/premium-bundle`} />
|
<CheckoutForm returnUrl={returnUrl} />
|
||||||
</Elements>
|
</Elements>
|
||||||
|
|
||||||
{isSuccess && (
|
{isSuccess && (
|
||||||
|
|||||||
@ -12,7 +12,8 @@ import { useApi } from '@/api';
|
|||||||
import { useAuth } from "@/auth";
|
import { useAuth } from "@/auth";
|
||||||
import CheckoutForm from "@/components/PaymentPage/methods/Stripe/CheckoutForm";
|
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() {
|
export default function PremiumBundleScreen() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -29,7 +30,7 @@ export default function PremiumBundleScreen() {
|
|||||||
(async () => {
|
(async () => {
|
||||||
const products = await api.getSinglePaymentProducts({ token });
|
const products = await api.getSinglePaymentProducts({ token });
|
||||||
|
|
||||||
const product = products.find((product) => product.productId === currentProductId);
|
const product = products.find((product) => product.key === currentProductKey);
|
||||||
|
|
||||||
if (product) {
|
if (product) {
|
||||||
setProductId(product.productId);
|
setProductId(product.productId);
|
||||||
@ -63,7 +64,7 @@ export default function PremiumBundleScreen() {
|
|||||||
paymentInfo: {
|
paymentInfo: {
|
||||||
productId,
|
productId,
|
||||||
},
|
},
|
||||||
return_url: `${window.location.host}/palmistry/premium-bundle`,
|
return_url: returnUrl,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -215,7 +216,7 @@ export default function PremiumBundleScreen() {
|
|||||||
{stripePromise && clientSecret && (
|
{stripePromise && clientSecret && (
|
||||||
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
|
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
|
||||||
<Elements stripe={stripePromise} options={{ clientSecret }}>
|
<Elements stripe={stripePromise} options={{ clientSecret }}>
|
||||||
<CheckoutForm returnUrl={window.location.host} />
|
<CheckoutForm returnUrl={returnUrl} />
|
||||||
</Elements>
|
</Elements>
|
||||||
|
|
||||||
{isSuccess && (
|
{isSuccess && (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user