synapsepay
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -11,3 +11,5 @@ 'use strict'; | ||
* @param options [Object] : can be null (if getting all nodes) or | ||
{ _id: node_id } (if getting info on single node) | ||
(if getting info on single node) | ||
{ _id: node_id, | ||
full_dehydrate: 'yes' //optional } | ||
* @param callback [function(error, nodeResponseObject)] | ||
@@ -28,2 +30,5 @@ **/ | ||
} | ||
if (options.full_dehydrate) { | ||
url += `?full_dehydrate=${options.full_dehydrate}`; | ||
} | ||
} | ||
@@ -30,0 +35,0 @@ APIClient.get(url, config, (err, json) => { |
@@ -8,3 +8,2 @@ 'use strict'; | ||
const Users = { | ||
/** Gets all users or one user (if given userId) | ||
@@ -16,6 +15,8 @@ * @param client [object] : contains client_id, client_secret, is_production | ||
fingerprint: USER_FINGERPRINT, | ||
ip_address: Helpers.getUserIP() | ||
ip_address: Helpers.getUserIP(), | ||
full_dehydrate: 'yes' //optional | ||
}; | ||
e.g. (if getting all users) | ||
const options = { | ||
ip: Helpers.getUserIP(), | ||
page: '', //optional | ||
@@ -37,2 +38,7 @@ per_page: '', //optional | ||
if (options) { | ||
if (!options.ip_address) { | ||
callback(new Error('Missing options "ip_address".')); | ||
} else { | ||
config.ip_address = options.ip_address; | ||
} | ||
// if user_id provided | ||
@@ -42,8 +48,9 @@ if (options._id) { | ||
callback(new Error('Missing options "fingerprint" when getting specific user.')); | ||
} else if (!options.ip_address) { | ||
callback(new Error('Missing options "ip_address" when getting specific user.')); | ||
} else { | ||
config.ip_address = options.ip_address; | ||
config.fingerprint = options.fingerprint; | ||
url += '/' + String(options._id); | ||
// optional query param | ||
if (options.full_dehydrate) { | ||
url += `?full_dehydrate=${options.full_dehydrate}`; | ||
} | ||
APIClient.get(url, config, (err, json) => { | ||
@@ -72,4 +79,3 @@ if (err) { | ||
} | ||
} | ||
else { | ||
} else { | ||
APIClient.get(url, config, (err, json) => { | ||
@@ -76,0 +82,0 @@ callback(err, json); |
{ | ||
"name": "synapsepay", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Node.js Library for SynapsePay API v3.x Rest", | ||
@@ -14,3 +14,3 @@ "main": "index.js", | ||
], | ||
"author": "SynapsePay LLC.<help@synapsepay.com>", | ||
"author": "Synapse Financial Technologies Inc.<help@synapsepay.com>", | ||
"license": "(ISC)", | ||
@@ -17,0 +17,0 @@ "devDependencies": { |
@@ -22,3 +22,3 @@ ## SynapsePay-Node | ||
Copyright (c) 2015 SynapsePay LLC | ||
Copyright (c) Synapse Financial Technologies Inc. 2017 | ||
@@ -25,0 +25,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of |
@@ -82,3 +82,4 @@ | ||
fingerprint: USER_FINGERPRINT, | ||
ip_address: Helpers.getUserIP() | ||
ip_address: Helpers.getUserIP(), | ||
full_dehydrate: 'yes' //optional | ||
}; | ||
@@ -99,5 +100,6 @@ | ||
let options = { | ||
page: '', | ||
per_page: '', | ||
query: '' | ||
ip_address: Helpers.getUserIP(), | ||
page: '', //optional | ||
per_page: '', //optional | ||
query: '' //optional | ||
}; | ||
@@ -169,34 +171,2 @@ | ||
// Answer KBA Questions if Virtual Doc Status is SUBMITTED|MFA_PENDING | ||
const kbaPayload = { | ||
documents: [{ | ||
id: BASE_DOCUMENT_ID, | ||
virtual_docs: [{ | ||
id: VIRTUAL_DOC_ID, | ||
meta: { | ||
question_set: { | ||
answers: [ | ||
{ question_id: 1, answer_id: 1 }, | ||
{ question_id: 2, answer_id: 1 }, | ||
{ question_id: 3, answer_id: 1 }, | ||
{ question_id: 4, answer_id: 1 }, | ||
{ question_id: 5, answer_id: 1 } | ||
] | ||
} | ||
} | ||
}] | ||
}] | ||
}; | ||
user.answerKBA( | ||
kbaPayload, | ||
function(err, userResponse) { | ||
// error or user object | ||
user = userResponse; | ||
} | ||
); | ||
// Update Existing Base Document | ||
@@ -249,3 +219,4 @@ | ||
{ | ||
_id: NODE_ID | ||
_id: NODE_ID, | ||
full_dehydrate: 'yes' //optional | ||
}, | ||
@@ -252,0 +223,0 @@ function(err, nodeResponse) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27987
15
621
1