Server SDK Migration Guide
Availability
This page is only relevant for:
- PHP migrating from version 5.5.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,
- Ruby migrating from version 3.4.0 and below.
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.
SDK major version 6
PHP 8
Previous versions of the Braintree PHP SDK supported PHP 7.2. Starting with version 6.0.0, the SDK
supports PHP 7.3 and higher, including PHP 8.
Google Pay
Previous versions of the PHP SDK represented Google Pay cards as Android Pay cards to prevent
breaking changes. In version 6.0.0,
AndroidPayCard
and AndroidPayCardDetails
were renamed to
GooglePayCard
and GooglePayCardDetails
. See the
Google Pay Guide
for more details.
SDK major version 5
PHP 7
Previous versions of the Braintree PHP SDK supported PHP 5. Starting with version 5.0.0, the SDK
supports PHP 7.2 and higher.
PSR-4 namespacing
Previous versions of the Braintree SDK supported class aliases with underscores, for instance
Braintree_Gateway
to support the PHP standard PSR-0. Version 5.0.0 and onward drop
support for that standard because it is deprecated, in favor of
PSR-4. This may require an update if you were
previously using the underscore syntax to load Braintree modules. If you were using underscores to
load modules:- PHP
$gateway = new Braintree_Gateway([
'environment' => 'sandbox',
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
- PHP
$gateway = new Braintree\Gateway([
'environment' => 'sandbox',
'merchantId' => 'your_merchant_id',
'publicKey' => 'your_public_key',
'privateKey' => 'your_private_key'
]);
- PHP
PHP Fatal error: Uncaught Error: Class 'Braintree_Gateway' not found in /your/directory/YourFile.php