add : Sep gateway for test
This commit is contained in:
@@ -15,8 +15,8 @@ class SepGateway {
|
||||
private logger = new Logger(SepGateway.name);
|
||||
|
||||
private gatewayApiUrl: string = process.env.SEP_HOST || "https://sep.shaparak.ir";
|
||||
private callBackURL = `${process.env.SITE_URL}/payment/verify/SEP/`;
|
||||
private TERMINAL_ID: string = process.env.SEP_TERMINAL_ID || "15364098";
|
||||
private callBackURL = `${process.env.SITE_URL}/payment/verify/saman/`;
|
||||
private TERMINAL_ID: string = process.env.SEP_TERMINAL_ID || "15364098";
|
||||
private requestHeader = { "Content-Type": "application/json", Accept: "application/json" };
|
||||
|
||||
async processPayment(amount: number, description: string, email: string, mobile: string, callBackPath: string) {
|
||||
@@ -25,18 +25,17 @@ class SepGateway {
|
||||
}
|
||||
const requesturl = `${this.gatewayApiUrl}/onlinepg/onlinepg`;
|
||||
|
||||
console.log("SEP Gateway processPayment called", email);
|
||||
console.log("SEP Gateway processPayment called", email, description);
|
||||
try {
|
||||
const purchaseData = {
|
||||
Action: "Token",
|
||||
TerminalId: this.TERMINAL_ID,
|
||||
Amount: amount, // ریال
|
||||
OrderId: description,
|
||||
RedirectUrl: `${this.callBackURL}${callBackPath}`,
|
||||
ResNum: "1qaz@WSX",
|
||||
ResNum: Date.now().toString(),
|
||||
CellNumber: mobile,
|
||||
};
|
||||
|
||||
console.log("purchase data", purchaseData);
|
||||
const response = await axios.post<SepRequestPaymentResponse>(requesturl, purchaseData, { headers: this.requestHeader });
|
||||
const data = response.data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user