Add event type redirect URL (#8385)

pull/8363/head^2
Joe Au-Yeung 2023-04-19 16:46:59 -04:00 committed by GitHub
parent 8a2ab68e9a
commit 2ac5ef10ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -57,19 +57,17 @@ const PaymentForm = (props: Props) => {
email: router.query.email,
};
if (paymentOption === "HOLD" && "setupIntent" in props.payment.data) {
const setupIntentData = props.payment.data as unknown as StripeSetupIntentData;
payload = await stripe.confirmSetup({
elements,
confirmParams: {
return_url: `${CAL_URL}/booking/${props.bookingUid}`,
return_url: props.eventType.successRedirectUrl || `${CAL_URL}/booking/${props.bookingUid}`,
},
});
} else if (paymentOption === "ON_BOOKING") {
const paymentData = props.payment.data as unknown as StripePaymentData;
payload = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: `${CAL_URL}/booking/${props.bookingUid}`,
return_url: props.eventType.successRedirectUrl || `${CAL_URL}/booking/${props.bookingUid}`,
},
});
}