Merge branch 'palmistry-discount-page' into 'develop'

Palmistry discount page

See merge request witapp/aura-webapp!62
This commit is contained in:
Victor Ershov 2024-03-25 23:09:07 +00:00
commit 40c9809225
2 changed files with 10 additions and 8 deletions

View File

@ -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 && (
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
<Elements stripe={stripePromise} options={{ clientSecret }}>
<CheckoutForm returnUrl={`${window.location.host}/palmistry/premium-bundle`} />
<CheckoutForm returnUrl={returnUrl} />
</Elements>
{isSuccess && (

View File

@ -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 && (
<div className={`discount-screen__widget${isSuccess ? " discount-screen__widget_success" : ""}`}>
<Elements stripe={stripePromise} options={{ clientSecret }}>
<CheckoutForm returnUrl={window.location.host} />
<CheckoutForm returnUrl={returnUrl} />
</Elements>
{isSuccess && (