payment refactor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user