diff --git a/src/modules/IPG/gateways/sep.ts b/src/modules/IPG/gateways/sep.ts index 49585e8..b8e9431 100644 --- a/src/modules/IPG/gateways/sep.ts +++ b/src/modules/IPG/gateways/sep.ts @@ -40,7 +40,7 @@ class SepGateway implements IGateway { if (!this.gatewayApiUrl || !this.terminalNumber) { throw new InternalError(["SEP gateway is not configured"]); } - await this.checkOutgoingIp(); + const requesturl = `${this.gatewayApiUrl}/onlinepg/onlinepg`; try { @@ -51,7 +51,7 @@ class SepGateway implements IGateway { RedirectUrl: `${this.callBackURL}${callBackPath}`, ResNum: Date.now().toString(), CellNumber: _mobile, - }; + }; const response = await axios.post(requesturl, purchaseData, { headers: this.requestHeader }); const data = response.data; @@ -93,7 +93,7 @@ class SepGateway implements IGateway { ); const sepResponse = response.data; - + console.log('sepResponse verify response *', sepResponse) // Normalize SEP response to match expected format // SEP considers ResultCode = 0 and Success = true as successful const isSuccess = sepResponse.ResultCode === 0 && sepResponse.Success === true; diff --git a/src/modules/payment/providers/payment.service.ts b/src/modules/payment/providers/payment.service.ts index 4b4c874..02dd4ac 100644 --- a/src/modules/payment/providers/payment.service.ts +++ b/src/modules/payment/providers/payment.service.ts @@ -185,8 +185,6 @@ class PaymentService { // Handle unsuccessful payment status if (status !== "OK") { - // user can retry - // await this.handleFailedPayment(paymentData._id.toString(), order._id, orderItems, session); return this.buildPaymentResponse(status, PaymentMessage.PaymentNotSuccessful, paymentData._id.toString(), order._id); } @@ -198,7 +196,7 @@ class PaymentService { const data = await this.paymentGateway.verifyPayment(gateway, verifyData); console.log("verify payment data**", data); - + if (data.code === 100 || data.code === 101) { await this.handleSellerNotify(order._id, user, session); // For SEP gateway, save refNum as transaction_id; for Zarinpal, save ref_id