fix: add metadata to stripe payment intent (#11053)
parent
b2e098c781
commit
6e1a717ecf
|
@ -50,7 +50,8 @@ export class PaymentService implements IAbstractPaymentService {
|
|||
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
|
||||
bookingId: Booking["id"],
|
||||
bookerEmail: string,
|
||||
paymentOption: PaymentOption
|
||||
paymentOption: PaymentOption,
|
||||
eventTitle?: string
|
||||
) {
|
||||
try {
|
||||
// Ensure that the payment service can support the passed payment option
|
||||
|
@ -78,6 +79,12 @@ export class PaymentService implements IAbstractPaymentService {
|
|||
currency: this.credentials.default_currency,
|
||||
payment_method_types: ["card"],
|
||||
customer: customer.id,
|
||||
metadata: {
|
||||
identifier: "cal.com",
|
||||
bookingId,
|
||||
bookerEmail,
|
||||
eventName: eventTitle || "",
|
||||
},
|
||||
};
|
||||
|
||||
const paymentIntent = await this.stripe.paymentIntents.create(params, {
|
||||
|
|
|
@ -59,7 +59,8 @@ const handlePayment = async (
|
|||
},
|
||||
booking.id,
|
||||
bookerEmail,
|
||||
paymentOption
|
||||
paymentOption,
|
||||
evt.title
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ export interface IAbstractPaymentService {
|
|||
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
|
||||
bookingId: Booking["id"],
|
||||
bookerEmail: string,
|
||||
paymentOption: PaymentOption
|
||||
paymentOption: PaymentOption,
|
||||
eventTitle?: string
|
||||
): Promise<Payment>;
|
||||
/* This method is to collect card details to charge at a later date ex. no-show fees */
|
||||
collectCard(
|
||||
|
|
Loading…
Reference in New Issue