feat(payment): add raw logs, IP/UA capture, exponential backoff, inventory hold, IPaymentGateway interface and admin health check
Deploy Canina / deploy (push) Successful in 1m53s
Deploy Canina / deploy (push) Successful in 1m53s
This commit is contained in:
1 parent
5ace474d71
commit
6e98b8779d
18 files changed
+11978
-9477
No files matched your search
@@ -0,0 +1,55 @@
|
||||
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>;
|
||||
}
|
||||
Reference in new issue
Block a user