Skip to content

scala-network/ScalaPay-Merchant-NPM

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

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

About

ScalaPay Merchant Endpoint NPM Module

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published