-
Notifications
You must be signed in to change notification settings - Fork 758
Version 2
James Padolsey edited this page Oct 20, 2013
·
6 revisions
On October 18th 2013 the node-stripe
repo (originally created by Ask Bjørn Hansen) was transferred to stripe/stripe-node, where it will continue to be officially maintained by Stripe.
Alongside this transfer, Stripe has released version 2.0.0 of the bindings, which includes the following new features:
- Added various missing resources (disputes, cards, etc.)
- Refactored the codebase: cleanliness and testability were the priorities
- Renewed the test suite (including integration and unit tests)
- All resource methods now return promises (in addition to supporting callbacks)
Version 2.0.0 is mostly compatible with earlier versions. There are a few differences that are important to note:
- We now use camel-case for resources and method names, so:
-
stripe.customers.update_subscription
is nowstripe.customer.updateSubscription
-
stripe.invoice_items
is nowstripe.invoiceItems
- etc.
-
stripe.token
is nowstripe.tokens
(pluralized) - All
create
methods take an object as the first argument. - What was
stripe.invoices.create(customer.id)
is nowstripe.invoices.create({customer: customer.id})
- Error objects returned to you via
callback(err)
or a rejected promise are structured differently. Read more about error handling.
It is also important for you to check what version of the Stripe REST API you're currently consuming.