This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
const Paynow = require("paynow");
let paynow = new Paynow(process.env.integrationid, process.env.integrationkey);
paynow.resultUrl = "https://www.example.com/gateways/paynow/update";
paynow.returnUrl = "httpw://www.example.com/return?gateway=paynow";
let payment = paynow.createPayment("Invoice 007");
payment.add("Laser Guided Missile", 11.99);
payment.add("Glock 19", 5.49);
paynow.send(payment).then(response => {
if (response.success) {
let link = response.redirectUrl;
console.log(`Go to ${link} to complete the transaction.`);
}
else {
console.log(response.error);
}
});