Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scala-network/scalapay-merchant-npm
ScalaPay Merchant Endpoint NPM Module
https://github.com/scala-network/scalapay-merchant-npm
crypto nodejs npm scalapay
Last synced: 11 days ago
JSON representation
ScalaPay Merchant Endpoint NPM Module
- Host: GitHub
- URL: https://github.com/scala-network/scalapay-merchant-npm
- Owner: scala-network
- License: mit
- Created: 2019-08-10T15:19:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T16:07:03.000Z (almost 5 years ago)
- Last Synced: 2025-01-22T04:41:23.632Z (12 days ago)
- Topics: crypto, nodejs, npm, scalapay
- Language: JavaScript
- Size: 9.77 KB
- Stars: 8
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScalaPay Merchant NPM
[![NPM Version][npm-version-image]][npm-url]
## Table of Contents
- [Install](#install)
- [Introduction](#introduction)
- [Recommendation](#recommendation)## Install
This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/). Node.js 0.6 or higher is required.
Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ 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:
```js
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
```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
```js
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);
});
```[npm-url]: https://npmjs.org/package/scalapay
[npm-version-image]: https://badgen.net/npm/v/scalapay