first commit

This commit is contained in:
2026-01-27 12:07:39 +03:30
commit 2cdf04d589
19 changed files with 7624 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
const moment = require("moment");
const soap = require("soap");
const { TERMINALID, USERNAME, USERPASSWORD, MELLATWSDL } = require("./data");
function bpCumulativeDynamicPayRequest(
orderId,
priceAmount,
additionalText,
callbackUrl
) {
const localDate = moment().format("YYYYMMDD");
const localTime = moment().format("HHmmss");
const args = {
terminalId: TERMINALID,
userName: USERNAME,
userPassword: USERPASSWORD,
orderId: orderId,
amount: priceAmount,
localDate: localDate,
localTime: localTime,
additionalData: additionalText,
callBackUrl: callbackUrl,
};
var options = {
overrideRootElement: {
namespace: "ns1",
},
};
return new Promise((resolve, reject) => {
soap.createClient(MELLATWSDL, options, (err, client) => {
client.bpCumulativeDynamicPayRequest(args, (err, result, body) => {
if (err) {
//console.log(err);
reject(err);
}
return resolve(result);
});
});
});
}
module.exports = { bpCumulativeDynamicPayRequest };