Comparing version 1.0.0 to 1.1.0
@@ -30,3 +30,4 @@ /* Copyright 2011 Ask Bjørn Hansen, see LICENSE */ | ||
} | ||
callback(err, response) | ||
err && (err = { statusCode: err, response: response }); | ||
callback(err, response); | ||
}); | ||
@@ -128,3 +129,3 @@ }); | ||
if (!(customer_id && typeof customer_id === 'string')) { | ||
cb("customer_id required"); | ||
return cb("customer_id required"); | ||
} | ||
@@ -155,3 +156,3 @@ get("/v1/customers/" + customer_id, {}, cb); | ||
if (!(plan_id && typeof plan_id === 'string')) { | ||
cb("plan_id required"); | ||
return cb("plan_id required"); | ||
} | ||
@@ -184,3 +185,3 @@ get("/v1/plans/" + plan_id, {}, cb); | ||
if (!(invoice_item_id && typeof invoice_item_id === 'string')) { | ||
cb("invoice_item_id required"); | ||
return cb("invoice_item_id required"); | ||
} | ||
@@ -199,2 +200,19 @@ get("/v1/invoiceitems/" + invoice_item_id, {}, cb); | ||
}, | ||
coupons: { | ||
create: function (data, cb) { | ||
post("/v1/coupons", data, cb); | ||
}, | ||
retrieve: function(coupon_id, cb) { | ||
if (!(coupon_id && typeof coupon_id === 'string')) { | ||
cb("coupon_id required"); | ||
} | ||
get("/v1/coupons/" + coupon_id, {}, cb); | ||
}, | ||
del: function(coupon_id, cb) { | ||
del("/v1/coupons/" + coupon_id, {}, cb); | ||
}, | ||
list: function(count, offset, cb) { | ||
get("/v1/coupons", { count: count, offset: offset}, cb ); | ||
} | ||
}, | ||
token: { | ||
@@ -201,0 +219,0 @@ create: function (data, cb) { |
@@ -5,3 +5,3 @@ { | ||
"description": "Stripe API wrapper", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/abh/node-stripe", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -61,2 +61,7 @@ # node-stripe | ||
* `.list(customer_id, count, offset)` - [list invoice items](https://stripe.com/docs/api#list_invoiceitems); all parameters are optional | ||
* `stripe.coupons` - create, retrieve, delete and list coupons | ||
* `.create(coupon)` - [create a coupon](https://stripe.com/docs/api#create_coupon), takes the data as an object | ||
* `.retrieve(coupon_id)` - [retrieve a coupon](https://stripe.com/docs/api#retrieve_coupon) by coupon id. | ||
* `.del(coupon_id)` - [delete a coupon](https://stripe.com/docs/api#delete_coupon) | ||
* `.list(count, offset)` - [list coupons](https://stripe.com/docs/api#list_coupons) | ||
* `stripe.token` - [Tokens API](https://stripe.com/docs/api#tokens) | ||
@@ -63,0 +68,0 @@ * `.create(card_data)` - [create a token](https://stripe.com/docs/api#create_token) |
Sorry, the diff of this file is not supported yet
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
33151
619
105