add : Sep gateway for test
This commit is contained in:
@@ -23,6 +23,7 @@ class SepGateway {
|
|||||||
if (!this.gatewayApiUrl || !this.TERMINAL_ID) {
|
if (!this.gatewayApiUrl || !this.TERMINAL_ID) {
|
||||||
throw new InternalError(["SEP gateway is not configured"]);
|
throw new InternalError(["SEP gateway is not configured"]);
|
||||||
}
|
}
|
||||||
|
await this.checkOutgoingIp();
|
||||||
const requesturl = `${this.gatewayApiUrl}/onlinepg/onlinepg`;
|
const requesturl = `${this.gatewayApiUrl}/onlinepg/onlinepg`;
|
||||||
|
|
||||||
console.log("SEP Gateway processPayment called", email, description);
|
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) {
|
async verifyPayment(authority: string, amount: number) {
|
||||||
if (!this.gatewayApiUrl || !this.TERMINAL_ID) {
|
if (!this.gatewayApiUrl || !this.TERMINAL_ID) {
|
||||||
throw new InternalError(["SEP gateway is not configured"]);
|
throw new InternalError(["SEP gateway is not configured"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user