* app initialization * btcpay-calcom payment * include logo and images * resolve comments * include USD and webhook cleaning * currency display * fix type error * payment service create error * type error fix * icon update * bot feedback update * Remove console * Remove currency suffix in price * fix coderRabbit comment * resolve extra comments * Use repositories and declarative installation ocode for app * use PrismaBookingPaymentRepository as well as fix UI view * Avoid fetching booking just for title which is already passed to create fn in handlePayment * fix type issues * return 200 if payment is already processed --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Omar López <zomars@me.com>
38 lines
831 B
TypeScript
38 lines
831 B
TypeScript
import type { JsonValue } from "@calcom/types/Json";
|
|
|
|
export interface BookingPaymentWithCredentials {
|
|
id: number;
|
|
amount: number;
|
|
success: boolean;
|
|
bookingId: number;
|
|
booking: {
|
|
user: {
|
|
credentials: Array<{
|
|
key: JsonValue;
|
|
}>;
|
|
} | null;
|
|
} | null;
|
|
}
|
|
|
|
export interface CreatePaymentData {
|
|
uid: string;
|
|
app: { connect: { slug: string } };
|
|
booking: { connect: { id: number } };
|
|
amount: number;
|
|
fee: number;
|
|
externalId: string;
|
|
refunded: boolean;
|
|
success: boolean;
|
|
currency: string;
|
|
data: Record<string, any>;
|
|
}
|
|
|
|
export interface IBookingPaymentRepository {
|
|
findByExternalIdIncludeBookingUserCredentials(
|
|
externalId: string,
|
|
credentialType: string
|
|
): Promise<BookingPaymentWithCredentials | null>;
|
|
|
|
createPaymentRecord(data: CreatePaymentData): Promise<any>;
|
|
}
|