Skip to content

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)

Incompatibilities with < 2.0.0

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 now stripe.customer.updateSubscription
  • stripe.invoice_items is now stripe.invoiceItems
  • etc.
  • stripe.token is now stripe.tokens (pluralized)
  • All create methods take an object as the first argument.
  • What was stripe.invoices.create(customer.id) is now stripe.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.

Clone this wiki locally