From 0c4b7b175f5f8c6f74f3b0e747693dc02e415a5b Mon Sep 17 00:00:00 2001 From: Nitai Date: Sat, 2 Jan 2016 13:24:06 -0700 Subject: [PATCH 1/2] Added OnTineInvoice --- lib/cheddargetter.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/cheddargetter.js b/lib/cheddargetter.js index 1ca2be1..d9826ed 100644 --- a/lib/cheddargetter.js +++ b/lib/cheddargetter.js @@ -156,3 +156,9 @@ cheddargetter.prototype.deleteCustomCharge = function (customerCode, chargeId, c chargeId = {chargeId: chargeId}; this.callAPI(amount, "/customers/delete-charge/productCode/" + this.productCode + "/code/" + customerCode, callback); }; + +cheddargetter.prototype.oneTimeInvoice = function (customerCode, charges, callback) { + var data = { charges : charges }; + this.callAPI(data, "/invoices/new/productCode/" + this.productCode + "/code/" + customerCode, callback); +}; + From 032fd4a76693f720f695fb5b4866f161833cc242 Mon Sep 17 00:00:00 2001 From: nitai Date: Wed, 27 Jan 2016 12:04:20 -0700 Subject: [PATCH 2/2] - adjusted OneTimeInvoice to accept remoteAddress - Updated ReadMe --- README.md | 1 + lib/cheddargetter.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5663b17..146d447 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ As of version 0.1.4 the module implements the fallowing API calls: * `setItemQuantity(customerCode, itemCode, amount, callback)` * `addCustomCharge(customerCode, chargeCode, quantity, amount, description, callback)` * `deleteCustomCharge(customerCode, chargeId, callback)` +* `oneTimeInvoice(customerCode, {data}, callback)` All callbacks are called with `error` and `results` parameters. diff --git a/lib/cheddargetter.js b/lib/cheddargetter.js index d9826ed..366cee8 100644 --- a/lib/cheddargetter.js +++ b/lib/cheddargetter.js @@ -157,8 +157,7 @@ cheddargetter.prototype.deleteCustomCharge = function (customerCode, chargeId, c this.callAPI(amount, "/customers/delete-charge/productCode/" + this.productCode + "/code/" + customerCode, callback); }; -cheddargetter.prototype.oneTimeInvoice = function (customerCode, charges, callback) { - var data = { charges : charges }; +cheddargetter.prototype.oneTimeInvoice = function (customerCode, data, callback) { this.callAPI(data, "/invoices/new/productCode/" + this.productCode + "/code/" + customerCode, callback); };