Skip to content

Scheduling infrastructure for absolutely everyone.

Fixes paid bookings

zomars9fba3f376771
diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx
index 853fcb0da95..1b1ab61d87d 100644
--- a/apps/web/components/booking/pages/BookingPage.tsx
+++ b/apps/web/components/booking/pages/BookingPage.tsx
@@ -129,6 +129,7 @@ const BookingPage = ({
paymentUid,
date,
name: attendees[0].name,
+ email: attendees[0].email,
absolute: false,
})
);
diff --git a/apps/web/ee/components/stripe/Payment.tsx b/apps/web/ee/components/stripe/Payment.tsx
index c6157114b2d..bde0ede1259 100644
--- a/apps/web/ee/components/stripe/Payment.tsx
+++ b/apps/web/ee/components/stripe/Payment.tsx
@@ -47,7 +47,7 @@ type States =
export default function PaymentComponent(props: Props) {
const { t, i18n } = useLocale();
const router = useRouter();
- const { name, date } = router.query;
+ const { email, name, date } = router.query;
const [state, setState] = useState<States>({ status: "idle" });
const stripe = useStripe();
const elements = useElements();
@@ -86,6 +86,7 @@ export default function PaymentComponent(props: Props) {
date,
type: props.eventType.id,
user: props.user.username,
+ email,
name,
bookingId: props.bookingId,
};
diff --git a/apps/web/ee/lib/stripe/server.ts b/apps/web/ee/lib/stripe/server.ts
index 625b985f6ae..953b3f27538 100644
--- a/apps/web/ee/lib/stripe/server.ts
+++ b/apps/web/ee/lib/stripe/server.ts
@@ -80,6 +80,7 @@ export async function handlePayment(
link: createPaymentLink({
paymentUid: payment.uid,
name: booking.user?.name,
+ email: booking.user?.email,
date: booking.startTime.toISOString(),
}),
},
diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsx
index 4b8e234d435..e7482deaa28 100644
--- a/apps/web/pages/success.tsx
+++ b/apps/web/pages/success.tsx
@@ -705,7 +705,7 @@ const schema = z.object({
recur: z.string().optional(),
location: z.string().optional(),
eventSlug: z.string().default("15min"),
- eventName: z.string(),
+ eventName: z.string().default(""),
bookingId: strToNumber,
});
diff --git a/packages/stripe/client.ts b/packages/stripe/client.ts
index 7616f8cddb6..5e87d7d7650 100644
--- a/packages/stripe/client.ts
+++ b/packages/stripe/client.ts
@@ -25,12 +25,13 @@ export function createPaymentLink(opts: {
paymentUid: string;
name?: Maybe<string>;
date?: Maybe<string>;
+ email?: Maybe<string>;
absolute?: boolean;
}): string {
- const { paymentUid, name, date, absolute = true } = opts;
+ const { paymentUid, name, email, date, absolute = true } = opts;
let link = "";
if (absolute) link = process.env.NEXT_PUBLIC_WEBSITE_URL!;
- const query = stringify({ date, name });
+ const query = stringify({ date, name, email });
return link + `/payment/${paymentUid}?${query}`;
}