Developer tools
Plugins
Magento
Installation

Installing the Magento Modules

Learn how to install, uninstall, and upgrade the Stripe Magento modules.

We recommend that you test the module on a testing server before installing it on your live web server. If you experience an installation issue, see the Troubleshooting documentation.

Download the module

Download the latest version of the Magento 2 module to get started with Stripe on your Magento site.

Install the module using Composer

Only the Magento 2 module can be installed using Composer.

  1. Place an order for the module through the Magento Marketplace.
  2. Open a terminal and run the following command in your Magento directory.
Terminal
composer require stripe/stripe-payments

If you’re using Composer for the first time, or if you see a Composer error, make sure that you’ve saved your authentication keys.

  1. Set up the module by running the following commands.
Terminal
php bin/magento setup:upgrade php bin/magento cache:flush php bin/magento cache:clean
  1. If you run Magento in production mode, you must also compile and deploy the module’s static files.
Terminal
php bin/magento setup:di:compile php bin/magento setup:static-content:deploy

Install the module using the Magento Admin Panel

Complete the following two steps before installing the Stripe module:

  • Magento relies on the cron command on your system. If you haven’t set up cron already, follow the official instructions from Magento before proceeding.

  • Ensure that your web server has full write access to the entire Magento directory using the official instructions. The simplest method is to change the ownership of the Magento directory to the same user that the web server is running under.

Terminal
chown –R <www-username> /magento_directory

To install the module:

  1. Place an order for the module through the Magento Marketplace.

  2. Navigate to the Setup Wizard located in System > Tools > Web Setup Wizard (also located at http://yourdomain.com/admin_xxxx/admin/backendapp/redirect/app/setup/).

    The Magento Setup Wizard

  3. From the Setup Wizard page, click Extension Manager.

  4. If you haven’t already done so, you will be asked to enter your Magento Marketplace authentication keys. You can find these on the Magento Marketplace.

  5. Within the Magento Marketplace Account section, click Install under New Purchases and follow the instructions to install the module.

  6. The installation can take 5 minutes or more while cron runs a complete job that upgrades Magento, re-deploys the static assets, recompiles the code, and other tasks. Leave the window open to allow the installation to finish.

If the installation fails or stalls with an Update pending message, you can check for errors in /var/log/update.log.

If the command succeeds, the contents of the files under the directory var/.update_* also update. If any errors occur, you can contact us for support.

Install the module manually

  1. Download the latest version of the module from Stripe.

  2. Extract the module in your Magento directory.

Terminal
tar -xvf stripe-magento2-x.x.x.tgz
  1. Install the Stripe PHP library.
Terminal
composer require stripe/stripe-php:^7
  1. Set up the module.
Terminal
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:flush
  1. If you run Magento in production mode, you must also compile and deploy the module’s static files.
Terminal
php bin/magento setup:di:compile php bin/magento setup:static-content:deploy

Get your authentication keys

This section only applies to the Magento 2 module if it was installed via Composer.

If you don’t have Composer installed, follow these installation instructions. During installation, you may be asked for a username and password. Provide your Magento 2 authentication keys.

You will also be asked to save your credentials. If you select Yes, Composer saves them in ~/.composer/auth.json.

If you’ve saved your keys and see the error Invalid Credentials, update them by editing ~/.composer/auth.json or delete the file and run the composer command again.

Migrating from other Stripe modules

From February 2018 to April 2019, Stripe provided another module on the Magento Marketplace. If you’re migrating from this legacy module, you must uninstall it first. Run the following command.

Terminal
composer remove stripeofficial/stripe-payments

You also need to remove any existing webhooks configured on the Dashboard.

After you remove both the legacy module and its webhooks configuration, follow the steps outlined above to install the new module. Any existing orders with the legacy module are automatically migrated when the new module is installed, so you can refund or capture those orders if needed.

These instructions also apply to the Cryozonic Stripe modules. Uninstall the modules and remove any existing webhooks. Orders placed with the Cryozonic modules automatically migrate to the new module upon installation, and any associated customers in the database are copied into the new module’s database tables.

Upgrade the module

If you used the manual installation method you can download the latest version of the module from Stripe’s website. When you have the latest version, uninstall the module and then reinstall the module.

If you installed using the Magento Admin Panel, run the following commands.

Terminal
composer remove stripe/stripe-payments composer require stripe/stripe-payments php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento cache:clean

If you don’t have SSH access, you can upgrade through the Magento admin instead.

  1. Navigate to the Setup Wizard at http://yourdomain.com/admin_xxxx/admin/backendapp/redirect/app/setup/.
  2. Click System Upgrade.
  3. In Other Components, select Yes.
  4. Select the module version you want to upgrade to and follow the instructions.

Uninstall the module

If you installed the module manually, run the following commands.

Terminal
php bin/magento module:disable --clear-static-content StripeIntegration_Payments composer remove stripe/stripe-php rm -rf app/code/StripeIntegration/Payments php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento cache:flush php bin/magento cache:clean

If you installed using the Magento Admin Panel, run the following commands.

Terminal
composer remove stripe/stripe-payments php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento cache:clean

See also

Learn more about how to configure and use the module.