From cd56a02144753f955f456a8ba816e578951f1011 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Tue, 30 Dec 2025 21:47:28 +0330 Subject: [PATCH] add : Sep gateway for test --- src/modules/IPG/gateways/sep.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/IPG/gateways/sep.ts b/src/modules/IPG/gateways/sep.ts index f94453a..817f4cb 100644 --- a/src/modules/IPG/gateways/sep.ts +++ b/src/modules/IPG/gateways/sep.ts @@ -23,6 +23,7 @@ class SepGateway { if (!this.gatewayApiUrl || !this.TERMINAL_ID) { throw new InternalError(["SEP gateway is not configured"]); } + await this.checkOutgoingIp(); const requesturl = `${this.gatewayApiUrl}/onlinepg/onlinepg`; console.log("SEP Gateway processPayment called", email, description); @@ -55,6 +56,16 @@ class SepGateway { } } + async checkOutgoingIp() { + try { + const response = await axios.get("https://api.ipify.org?format=json"); + console.log("Your Server's Public Outgoing IP is:", response.data.ip); + return response.data.ip; + } catch (error) { + console.error("Could not determine outgoing IP", error); + } + } + async verifyPayment(authority: string, amount: number) { if (!this.gatewayApiUrl || !this.TERMINAL_ID) { throw new InternalError(["SEP gateway is not configured"]);