import { type PaymentProvider } from '@prisma/client'; export const PAYMENT_GATEWAY_FACTORY = Symbol('PAYMENT_GATEWAY_FACTORY'); export interface CreatePaymentUrlParams { orderId: string; amountVND: bigint; description: string; returnUrl: string; ipAddress: string; } export interface CreatePaymentUrlResult { paymentUrl: string; providerTxId: string; } export interface CallbackVerifyResult { isValid: boolean; orderId: string; providerTxId: string; isSuccess: boolean; rawData: Record; } export interface RefundParams { providerTxId: string; amountVND: bigint; reason: string; } export interface RefundResult { success: boolean; refundTxId: string | null; } export interface IPaymentGateway { readonly provider: PaymentProvider; createPaymentUrl(params: CreatePaymentUrlParams): Promise; verifyCallback(data: Record): CallbackVerifyResult; refund(params: RefundParams): Promise; } export interface IPaymentGatewayFactory { getGateway(provider: PaymentProvider): IPaymentGateway; }