Files
canina/backend/src/payment/interfaces/payment-gateway.interface.ts
T
devops ddbf1ca026
Deploy Canina / deploy (push) Successful in 4m1s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s
test: comprehensive test suites and quality gates pass across backend, storefront and admin
- 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.
2026-10-13 16:01:00 +00:00

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>;
}