Developer tools
Plugins
Magento
Troubleshooting

Troubleshooting Magento

Learn how to troubleshoot the Stripe Magento modules.

Switching to developer mode

Before debugging any Magento 2 issue, you should enable Magento’s developer mode, as it’s hard to debug Magento 2 errors while in production mode.

Error logging and server-side errors (HTTP 500)

Magento logs any errors and exceptions it encounters during application runtime in the /var/log directory. You can find these errors in the following two files:

/var/log/system.log /var/log/exception.log

If you have SSH access, you can filter the error messages with the following command:

grep -i Stripe var/log/system.log

You can display errors live in the console as they occur (or when you refresh a given page)/ To monitor errors, run the following command to watch the error log:

tail -f var/log/*

If you don’t have shell access, you can download this file and search for Stripe errors with a text editor.

Upgrades and caching issues

If you have upgraded the module but for some reason you don’t see the new changes, you can manually clear the Magento 2 cache by deleting a set of directories. The official Magento documentation describes which directories to delete for Magento 2.2 and Magento 2.3.

After you delete these directories, run the following commands to refresh your Magento cache and static assets:

php bin/magento setup:upgrade php bin/magento cache:flush php bin/magento setup:static-content:deploy

If you’re running in production mode, you may also have to recompile Magento:

php bin/magento setup:di:compile

If you’re running Varnish, you must also restart Varnish after deleting the var/cache/* files. Some browsers also cache Magento 2 requests; if you still have caching issues, try a different browser.

Unable to use Stripe.js

This error message indicates that Stripe.js is not working correctly on the page that displayed this error. The most common reason for this error is another module that creates JavaScript errors; you should check for any other errors in the developer console of your browser.

This may also be an issue related to a conflicting OneStepCheckout module.

php bin/magento module:disable Vendor_ModuleName php bin/magento setup:upgrade php bin/magento cache:clean

If the problem persists after attempting the steps above, please contact magento@stripe.com for further guidance.

Stuck loading a spinner on the checkout page

This usually occurs due to a server-side error. Server-side errors are included in the Magento log files under /var/log (see how to enable error logging). If you enabled error logging and still can’t see the error, you may find one the log files of your web server. If you’re using a variant of PHP-FPM, make sure to also check the log files of your FastCGI backend.

If the error is not logged in any of the above places, using the developer console of your browser. Under the Network tab of the developer console you will see a red network request as shown in the screenshot below indicating a 500 error:

To identify the origin of the error, click on the line. You will see the error under the Response tab of the network request as shown below:

The error may indicate the origin of the error, usually an incompatibility with another module that overrides some part of the checkout process. You can disable modules by moving their XML configuration file from /app/etc/modules/ into a different directory. Don’t try to disable conflicting modules from the Magento Admin Panel, as it won’t work.

Composer authentication required (repo.magento.com)

If you are installing Composer for the first time, you may see this message in your console before installing the Stripe PHP library. You must provide your Magento 2 marketplace keys.

Failed, partial, and corrupted installations

Some crashes at the checkout page or the Magento Admin Panel may be caused by a partial or corrupted installation, often the result of incorrect filesystem write permissions. To fix a corrupted installation:

  1. Carefully follow the uninstall instructions.
  2. Clear your database with the following SQL queries:
DROP TABLE stripe_customers; DELETE FROM setup_module WHERE module = 'StripeIntegration_Payments';
  1. Check your filesystem permissions before reinstalling. You can fix most problems by changing the ownership of the Magento directories to the user running the web server with:
chown –R <www-username> /magento_directory

Alternatively, you can configure your web server to run as the same user that deploys these files to your website.

  1. Carefully follow the installation instructions.

The Apple Pay button does not appear

Make sure you’ve followed all steps in the Apple Pay configuration checklist. Some possible reasons for not seeing the Payment Request Button include:

  • You may have overwritten the Add to Cart button template in your theme. This is what the default template looks like:

The default template style for the Add to Cart button

If your payment form looks different, try adding some text to view/frontend/templates/express/product_button.phtml to see if it appears on the product page. If you don’t see any text, you should customize your theme to integrate the two templates together.

  • Check your browser console for any JavaScript errors related to Stripe.js. For example, you may have incorrectly entered your Stripe API keys.
  • Make sure you’re serving your page securely using TLS, which is required for the Payment Request Button to appear.
  • JavaScript bundling causes problems for some environments. If you have it enabled, try disabling it with:
php bin/magento config:set dev/js/enable_js_bundling 0 php bin/magento cache:clean

Order stuck with the Pending status

When an order is initially created, it will have a status of Pending, which indicates that the authorization of the payment by the customer’s bank is still pending. For all redirect-based payment methods, when an authorization occurs, Stripe notifies your website using webhooks. If your orders do not change from Pending to Processing, this may indicate that webhooks need to be configured for your website.

Error logging and server-side errors (HTTP 500)

The module logs any problems during checkout in Magento’s System Log file. To use this feature, enable logging from System > Configuration > Developer > Log Settings.

After you enable error logging, run the following command from your Magento directory (if you have shell access):

tail -f var/log/*

This displays any errors in your terminal. You can try to reproduce the error and see what errors are reported.

If you don’t have shell access, download the log file, open it with a text editor and search for the word Stripe.

Enabling error logging also writes to log files in the directory var/report/. Make sure that these directories have write permissions enabled in your Magento installation. To check the last 100 lines of the exception.log file, you can run the following command:

tail -100 var/log/exception.log

If you’re testing on a development website, you can also configure Magento to display exceptions directly on your website front-end. (You should avoid doing this in production.) Run the following command:

cp errors/local.xml.sample errors/local.xml

Unable to use Stripe.js

This error indicates that Stripe.js isn’t working correctly on your checkout page. There are usually two common causes for this error:

  1. JavaScript crashes: If you’re still developing the website, you probably have unstable modules with JavaScript crashes in the browser’s debugging console. When a JavaScript crash occurs, the browser halts all subsequent JavaScript execution, resulting in Stripe.js not initializing correctly at your checkout page. If you see any JavaScript crashes in your browser console, fix them first so that the checkout page initializes correctly.
  2. One Step Checkout modules: The Stripe Magento 1 module works with many OSC modules with no additional configuration required. Some OSC modules do require some extra steps to integrate.

Order stuck with the Pending status

Orders may get stuck with a Pending status (even if the payment was received) for a number of reasons:

  1. You may not have configured webhooks yet, which are needed for redirect-based payment methods such as 3D Secure, Bancontact, Alipay etc.
  2. You may have configured webhooks in Stripe for Test Mode, but your actual tests were in Live Mode. In this case, you must also configure webhooks for Live Mode.
  3. The URL used to configure webhooks may return a 301 Redirect status rather than 200 OK status. This can occur when providing the http:// protocol rather than https:// in your URL, or when www. is missing from the domain name.
  4. The endpoint can return a 400 or 500 status when webhook events are triggered, indicating an error. Errors are logged to var/log/cryozonic_stripe_webhooks.log.
  5. If the module’s Payment Action is configured as Authorize Only, then no invoices are created when an order is placed. You must manually issue an invoice, which will update the order status to Processing.
  6. If Automatic Invoicing is enabled, then an invoice is created with the Pending status, and the order has the Pending Payment status, which switches to Processing when the invoice is manually captured.
  7. If the payment method is asynchronous, it can take up to several days to confirm whether the payment was successful. During this time, the order in Magento has the Pending status.
Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.