bitpay-nodejs
Advanced tools
Comparing version 0.0.5 to 0.0.7
@@ -36,3 +36,3 @@ const request = require('request') | ||
console.log(options.url); | ||
options.methd = 'GET'; | ||
options.method = 'GET'; | ||
request(options, function(err, resp, body) { | ||
@@ -49,3 +49,36 @@ if(err) console.log(err); | ||
Client.prototype.getInvoiceData = function(invoiceId, fn) { | ||
var options = new Object(this.httpOptions); | ||
options.url = api+'/invoiceData/'+invoiceId; | ||
console.log(options.url); | ||
options.method = 'GET'; | ||
request(options, function(err, resp, body) { | ||
if(err) console.log(err); | ||
result = JSON.parse(body); | ||
if (result.error) { | ||
fn(result.error, null); | ||
} else { | ||
fn(null, result); | ||
} | ||
}); | ||
}; | ||
Client.prototype.sendNotification = function(invoiceId, fn) { | ||
var options = new Object(this.httpOptions); | ||
options.url = api+'/invoices/'+invoiceId+'/notifications'; | ||
console.log(options.url); | ||
options.method = 'POST'; | ||
request(options, function(err, resp, body) { | ||
if(err) console.log(err); | ||
result = JSON.parse(body); | ||
if (result.error) { | ||
fn(result.error, null); | ||
} else { | ||
fn(null, result); | ||
} | ||
}); | ||
}; | ||
module.exports = Client | ||
{ | ||
"name": "bitpay-nodejs", | ||
"version": "0.0.5", | ||
"version": "0.0.7", | ||
"description": "A Node.js library for the Bitpay Bitcoin API", | ||
@@ -5,0 +5,0 @@ "main": "bitpay.js", |
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
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
7725
163