payment refactor

This commit is contained in:
2025-12-15 23:42:28 +03:30
parent 3e4a4eebe4
commit 5a00874a4e
6 changed files with 344 additions and 432 deletions
+38
View File
@@ -0,0 +1,38 @@
export interface IPaymentGateway {
processPayment(processPaymentParam: IProcessPaymentParams): Promise<IProcessPaymentData>;
verifyPayment(verifyPaymentParam: IPaymentVerifyParams): Promise<IVerifyPayment>;
}
export interface IProcessPaymentParams {
amount: number;
callbackUrl: string;
merchantId: string;
description: string;
metadata: {
orderId: string;
};
}
export interface IProcessPaymentData {
code: number;
message: string;
authority: string;
fee_type: string;
fee: number;
}
export interface IPaymentVerifyParams {
merchantId: string;
amount: number;
authority: string;
}
export interface IVerifyPayment {
code: number;
message: string;
refId: number;
cardPan: string;
cardHash: string;
fee_type: string;
fee: number;
}
-34
View File
@@ -11,37 +11,3 @@ export enum PaymentStatusEnum {
export enum PaymentGatewayEnum {
ZarinPal = 'zarinpal',
}
export interface IPaymentRequest {
amount: number;
callbackUrl: string;
merchantId: string;
description: string;
metadata: {
orderId: string;
};
}
export interface IPaymentResponse {
code: number;
message: string;
authority: string;
fee_type: string;
fee: number;
}
export interface IPaymentVerifyRequest {
merchantId: string;
amount: number;
authority: string;
}
export interface IPaymentVerifyResponse {
code: number;
message: string;
refId: number;
cardPan: string;
cardHash: string;
fee_type: string;
fee: number;
}