feat: Write same metadata to Stripe for booking payment and no show fee payment (#23634)
* Add `findBookingById` to `BookingRepository` * Create `generateMetadata` to Stripe `PaymentService` * `create` method to use `generateMetadata` * Remove unused trpc endpoint * Pass booking id to chargeCard method * Use generateMetadata in chargeCard method * Remove unused stripeAppKeys * Add error handling if booking doesn't contain attendee * Rename to * Return attendees in a consistent order --------- Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
1 parent
7e876e3457
commit
31270ca86b
3 files changed
+94
-243
No files matched your search
@@ -387,6 +387,41 @@ export class BookingRepository {
|
||||
});
|
||||
}
|
||||
|
||||
async findByIdIncludeUserAndAttendees(bookingId: number) {
|
||||
return await this.prismaClient.booking.findUnique({
|
||||
where: {
|
||||
id: bookingId,
|
||||
},
|
||||
select: {
|
||||
...bookingMinimalSelect,
|
||||
eventType: {
|
||||
select: {
|
||||
title: true,
|
||||
},
|
||||
},
|
||||
user: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
attendees: {
|
||||
select: {
|
||||
name: true,
|
||||
email: true,
|
||||
phoneNumber: true,
|
||||
},
|
||||
// Ascending order ensures that the first attendee in the list is the booker and others are guests
|
||||
// See why it is important https://github.com/calcom/cal.com/pull/20935
|
||||
// TODO: Ideally we should return `booker` property directly from the booking
|
||||
orderBy: {
|
||||
id: "asc",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async findBookingForMeetingPage({ bookingUid }: { bookingUid: string }) {
|
||||
return await this.prismaClient.booking.findUnique({
|
||||
where: {
|
||||
|
||||
Reference in new issue
Block a user