Skip to content

Commit

Permalink
Add invoices API
Browse files Browse the repository at this point in the history
(Closes #6)
  • Loading branch information
abh committed Nov 26, 2011
1 parent 5fe8aae commit 3ad0ef0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -43,6 +43,10 @@ called with an error code (if any) and then the response.
* `.list(count, offset)` - [list customers](https://stripe.com/docs/api#list_customers)
* `.update_subscription(customer_id, data)` - [update subscription](https://stripe.com/docs/api#update_subscription)
* `.cancel_subscription(customer_id, at_period_end)` - [cancel subscription](https://stripe.com/docs/api#cancel_subscription)
* `stripe.invoices` - [Invoices API](https://stripe.com/docs/api#invoices)
* `.retrieve(invoice_id)` - [retrieve an existing invoice](https://stripe.com/docs/api?lang=curl#retrieve_invoice)
* `.upcoming(customer_id)` - [retrieve the upcoming invoice for a customer](https://stripe.com/docs/api?lang=curl#retrieve_customer_invoice)
* `.list(parameters)` - [list invoices](https://stripe.com/docs/api#list_customer_invoices)
* `stripe.token` - [Tokens API](https://stripe.com/docs/api#tokens)
* `.create(card_data)` - [create a token](https://stripe.com/docs/api#create_token)
* `.retrieve(token_id)` - [retrieve a card token](https://stripe.com/docs/api#retrieve_token)
Expand Down
11 changes: 11 additions & 0 deletions lib/main.js
Expand Up @@ -144,6 +144,17 @@ module.exports = function (api_key, options) {
del("/v1/customers/" + customer_id + '/subscription', { at_period_end: at_period_end }, cb);
}
},
invoices: {
retrieve: function(invoice_id, cb) {
get("/v1/invoices/" + invoice_id, {}, cb);
},
list: function(data, cb) {
get("/v1/invoices", data, cb);
},
upcoming: function(customer_id, cb) {
get("/v1/invoices/upcoming", { customer: customer_id }, cb);
},
},
token: {
create: function (data, cb) {
post("/v1/tokens", data, cb)
Expand Down

0 comments on commit 3ad0ef0

Please sign in to comment.