Skip to content
ScalaPay Merchant Endpoint NPM Module
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.DS_Store
.gitattributes
LICENSE
README.md
index.js
package.json

README.md

ScalaPay Merchant NPM

NPM Version

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 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);
});

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("philip119@gmx.de","1337", function(error, result) {
	if(error)
		console.log(error);
	else
		console.log(result);
});
You can’t perform that action at this time.