availability

This page is only relevant for:

  • PHP migrating from version 4.8.0 and below,
  • Python migrating from version 3.59.0 and below,
  • Java migrating from version 2.109.0 and below,
  • .NET migrating from version 4.18.0 and below,
  • Node migrating from version 2.24.0 and below.

You can skip this guide if you are using the Ruby Braintree SDK or starting a new integration using the latest version of another SDK.

Overview

Braintree makes regular updates to our server SDKs which follow semantic versioning guidelines. This page will guide you through the largest breaking changes that are specific to the language you are integrating with Braintree. Check the SDK's CHANGELOG for more information on changes.

Node Versions

Starting with version 3.0.0, the Braintree Node SDK targets Node versions 10+ and npm CLI 6+.

Creating a gateway instance

Previous code examples used the function connect() to set up the Braintree Gateway. This method was deprecated in version 2.15.0, and removed in version 3.0.0. Instead, initialize the gateway by creating a new instance:

Node.js
const gateway = new braintree.BraintreeGateway({
  environment: braintree.Environment.Sandbox,
  merchantId: 'your_merchant_id',
  publicKey: 'your_public_key',
  privateKey: 'your_private_key'
});
This code snippet creates a gateway instance using the latest version of the Node SDK. Learn more.

Search methods for expiring credit cards updated

Previous versions of the Node SDK contained a bug where the expired and expiringBetween methods on CreditCardGateway returned an array of credit card ids rather than the full results. These methods have been updated to return either an iterable response or a stream containing the full credit card result objects. See expiringBetween for more details.

Exceptions

Down For Maintenance exceptions have been renamed to Service Unavailable exceptions, since we do not bring our services down to perform maintenance operations anymore.

We also added additional timeout exceptions to give extra clarity on the source (client request vs gateway response).

For more information, check our guide on Exceptions.

Further reading