Skip to content

Upgrading from SolidusPaypalBraintree To SolidusBraintree

Thomas von Deyen edited this page Mar 26, 2023 · 10 revisions

Instructions

We decided to rename SolidusPaypalBraintree to SolidusBraintree to reflect the extensions content.

If you are using SolidusPaypalBraintree, there is a clear upgrade path to migrate to the new extension. Here are the steps:

  1. Upgrade solidus_paypal_braintree to 1.2. Be sure everything is working correctly at this point.
  2. Change gem 'solidus_paypal_braintree', ~> 1.2 to gem 'solidus_braintree', '~> 2.0.0', require: 'solidus_paypal_braintree' in your Gemfile. The require: 'solidus_paypal_braintree' part will allow the code to run, even if you still have references to the SolidusPaypalBraintree constant in your codebase.
  3. Run bin/rails g solidus_braintree:install, which will change all the references of SolidusPaypalBraintree into SolidusBraintree in your application. We will leave the database tables as they are. In fact, we are keeping the solidus_paypal_braintree prefix for database tables. Renaming tables can be a potentially risky operation, and we wanted to reduce the friction in updating to v2.0.0. For details, please see https://github.com/solidusio/solidus_braintree/issues/101.
  4. Be sure you don't have any solidus_paypal_braintree reference in the codebase (e.g. I18n translation keys).
  5. Be sure you don't have any SolidusPaypalBraintree reference in your codebase.
  6. Now that you don't have references to SolidusPaypalBraintree or solidus_paypal_braintree in your codebase, you can change gem 'solidus_braintree', '~> 2.0.0', require: 'solidus_paypal_braintree' to gem 'solidus_paypal_braintree', ~> 2.0 in your Gemfile.

Note on the rename

The original name of this extension, SolidusPaypalBraintree, was unfortunate. It's true that Braintree is a PayPal product, and you can pay with PayPal via Braintree with this extension, but this name is confusing because it's not clear what you are installing exactly.

On top of that, we already had a SolidusBraintree extension, which has been deprecated. The name also differentiates it from the official Solidus PayPal extension, SolidusPaypalCommercePlatform.

To reconcile this mess, we decided to deprecate SolidusPaypalBraintree and move it into SolidusBraintree.