feat: payment service with IPG
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { ZarinPalGateway } from "./gateways/zarinpal";
|
||||
|
||||
@Injectable()
|
||||
export class PaymentGateway {
|
||||
|
||||
constructor(
|
||||
private zarinpalGateway: ZarinPalGateway,
|
||||
) { }
|
||||
|
||||
async requestPayment(data: any) {
|
||||
return await this.zarinpalGateway.processPayment(data.amount, data.userId, data.callbackPath);
|
||||
}
|
||||
|
||||
async verifyPayment(data: any) {
|
||||
return await this.zarinpalGateway.verifyPayment(data.authority, data.amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user