add : Sep gateway for test

This commit is contained in:
2025-12-30 21:47:28 +03:30
parent 38dfc2545a
commit cd56a02144
+11
View File
@@ -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"]);