- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
export interface PaymentRequestOptions {
|
|
amountRials: number;
|
|
callbackUrl: string;
|
|
orderId?: string;
|
|
mobile?: string;
|
|
description?: string;
|
|
}
|
|
|
|
export interface PaymentRequestResult {
|
|
result: number;
|
|
trackId: string | number;
|
|
message?: string;
|
|
paymentUrl?: string;
|
|
}
|
|
|
|
export interface PaymentVerifyResult {
|
|
result: number;
|
|
refNumber?: string;
|
|
cardNumber?: string;
|
|
amount?: number;
|
|
paidAt?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export interface PaymentInquiryResult {
|
|
result: number;
|
|
status?: number;
|
|
amount?: number;
|
|
refNumber?: string;
|
|
cardNumber?: string;
|
|
paidAt?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export interface GatewayHealthResult {
|
|
gatewayName: string;
|
|
status: "ONLINE" | "DEGRADED" | "OFFLINE";
|
|
latencyMs: number;
|
|
merchantConfigured: boolean;
|
|
activeMerchant: string;
|
|
message: string;
|
|
checkedAt: Date;
|
|
}
|
|
|
|
/**
|
|
* Standard Payment Gateway Interface (Strategy / Gateway Adapter Pattern)
|
|
*/
|
|
export interface IPaymentGateway {
|
|
getGatewayName(): string;
|
|
requestPayment(options: PaymentRequestOptions): Promise<PaymentRequestResult>;
|
|
verifyPayment(trackId: string | number): Promise<PaymentVerifyResult>;
|
|
inquiryPayment(trackId: string | number): Promise<PaymentInquiryResult>;
|
|
getStartUrl(trackId: string | number): string;
|
|
checkHealth(): Promise<GatewayHealthResult>;
|
|
}
|