Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

synapsepay

Package Overview
Dependencies
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

synapsepay - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

test.js

9

lib/Transactions.js

@@ -7,3 +7,12 @@ 'use strict';

const Transactions = {
list(client, config, callback) {
let url = client.baseUrl + '/trans';
config.client = client;
APIClient.get(url, config, (err, json) => {
callback(err, json);
});
},
get(node, options, callback) {

@@ -10,0 +19,0 @@ const config = {

8

package.json
{
"name": "synapsepay",
"version": "0.3.0",
"version": "0.4.0",
"description": "Node.js Library for SynapsePay API v3.x Rest",
"repository": {
"type" : "git",
"url" : "https://github.com/SynapseFI/SynapseFI-Node.git"
},
"main": "index.js",

@@ -21,3 +25,3 @@ "scripts": {

"eslint-config-google": "^0.6.0",
"mocha": "^2.3.4",
"mocha": "^5.2.0",
"nock": "^3.3.2"

@@ -24,0 +28,0 @@ },

@@ -453,1 +453,148 @@

```
## Subscription API Calls
```javascript
// Imports
const Subscriptions = SynapsePay.Subscriptions;
// Create a Subscription
const createPayload = {
scope: [
'USERS|POST',
'USER|PATCH',
'NODES|POST',
'NODE|PATCH',
'TRANS|POST',
'TRAN|PATCH'
],
url: 'https://requestb.in/zp216zzp'
};
let subscription;
Subscriptions.create(
client,
createPayload,
function(err, subscriptionResp) {
// error or subscription object
subscription = subscriptionResp;
}
);
// Get a Subscription
Subscriptions.get(
client,
{
_id: SUBSCRIPTION_ID
},
function(err, subscriptionResp) {
// error or subscription object
subscription = subscriptionResp;
}
);
// Get All Subscriptions
let subscriptions;
Subscriptions.get(
client,
null,
function(err, subscriptionsResp) {
// error or subscription object
subscriptions = subscriptionsResp;
}
);
// Update Subscription
const updatePayload = {
scope : 'USERS|POST'
};
subscription.update(
updatePayload,
function(err, subscriptionResp) {
// error or subscription object
subscription = subscriptionResp;
}
);
```
## Subnet API Calls
```javascript
// Imports
const Subnets = SynapsePay.Subnets;
// Create a Subnet
const createPayload = {
nickname: "Test AC/RT"
};
let subnet;
Subnets.create(
node,
createPayload,
function(err, subnetResp) {
// error or subnet object
subnet = subnetResp;
}
);
// Get a Subnet
Subnets.get(
node,
{
_id: SUBNET_ID
},
function(err, subnetResp) {
// error or subnet object
subnet = subnetResp;
}
);
// Get All Subnets
let subnets;
Subnets.get(
node,
null,
function(err, subnetsResp) {
// error or subnet object
subnets = subnetsResp;
}
);
// Update Subnet
const updatePayload = {
allowed: 'LOCKED'
};
subnet.update(
updatePayload,
function(err, subnetResp) {
// error or subnet object
subnet = subnetResp;
}
);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc