scalapay
v1.0.3
Published
ScalaPay Merchant Endpoint NodeJS Module
Downloads
10
Readme
ScalaPay Merchant NPM
Table of Contents
Install
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
Introduction
This is a node.js driver for mysql. 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);
});
Recommendation
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("[email protected]","1337", function(error, result) {
if(error){
console.log(error);
else
console.log(result);
});