Preview/discount pages

This commit is contained in:
Денис Катаев 2024-02-24 01:29:01 +00:00 committed by Victor Ershov
parent ead3faa999
commit 737cda9770
2 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,8 @@ export interface SubscriptionReceipt {
error: string;
links?: IPayPalLink[];
stripe_status?: string;
checkout_url?: string;
checkout_session?: unknown;
};
}

View File

@ -81,6 +81,10 @@ function PaymentModal({ activeSubscriptionPlan }: IPaymentModalProps) {
});
const { id } = subscription_receipt;
const { client_secret } = subscription_receipt.data;
const { checkout_url } = subscription_receipt.data;
if (checkout_url?.length) {
window.location.href = checkout_url;
}
setSubscriptionReceiptId(id);
setClientSecret(client_secret);
setIsLoading(false);