chore: complete the payment service
This commit is contained in:
@@ -66,11 +66,14 @@ export class ZarinpalGateway implements IPaymentGateway {
|
||||
//********************************** */
|
||||
async verifyPayment(verifyParams: IPaymentVerifyParams) {
|
||||
try {
|
||||
const verifyData = { authority: verifyParams.reference, amount: verifyParams.amount, merchant_id: this.config.merchantId };
|
||||
|
||||
const verifyData = {
|
||||
authority: verifyParams.reference,
|
||||
amount: verifyParams.amount,
|
||||
merchant_id: this.config.merchantId,
|
||||
};
|
||||
const { data } = await firstValueFrom(
|
||||
this.httpService
|
||||
.post<ZarinPalPGVerifyData>(`${this.config.gatewayApiUrl}/v4/payment/verify.json`, verifyData, { headers: this.requestHeader })
|
||||
.post<ZarinPalPGVerifyData>(`${this.gatewayApiUrl}/v4/payment/verify.json`, verifyData, { headers: this.requestHeader })
|
||||
.pipe(
|
||||
catchError((err: AxiosError) => {
|
||||
this.logger.error(err);
|
||||
@@ -89,6 +92,7 @@ export class ZarinpalGateway implements IPaymentGateway {
|
||||
fee: data.data.fee,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error({ error });
|
||||
this.logger.error(error);
|
||||
throw new InternalServerErrorException(PaymentMessage.ERROR_IN_VERIFY_PAYMENT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user