This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.6 or higher is required.
Installation is done using the npm install
command:
$ npm i scalapay
This is a node.js wrapper for the scalapay merchant API. It is written in JavaScript, does not require compiling, and is 100% MIT licensed.
Here is an example on how to use it:
var scalapay = require('scalapay');
var scala = scalapay.login({
token : 'MERCHANT_TOKEN'
});
scala.testAccess(function(error, result) {
if(error){
console.log(error);
else
console.log(result);
});
Create a config file named /config/ScalaAPI.js
var scalapay = require('scalapay');
var Scala = scalapay.login({
token: "MERCHANT_TOKEN"
});
module.exports = Scala;
now you can use it in your other js files
const scala = require('./config/ScalaAPI');
scala.testAccess(function(error, result) {
if(error)
console.log(error);
else
console.log(result);
});
scala.generateAddress(function(error, result) {
if(error)
console.log(error);
else
console.log(result);
});
scala.transfer("philip119@gmx.de","1337", function(error, result) {
if(error)
console.log(error);
else
console.log(result);
});