Home > Docs > PayPal Express Checkout Payment Gateway for WooCommerce > PayPal Express Checkout Payment Gateway for WooCommerce – Trouble Shooting Guide

PayPal Express Checkout Payment Gateway for WooCommerce – Trouble Shooting Guide

Last updated on October 30, 2023

The PayPal express payment gateway for WooCommerce plugin is used to integrate PayPal with WooCommerce to accept payments through the secure PayPal payment gateway. However, sometimes the plugin can generate API errors and warning codes during the checkout process. Below, we’ve compiled a list of the most frequently encountered error codes, along with their potential causes and solutions.

1. Error Code 10002 – Security Header is Not Valid

This error message is often triggered when incorrect values are entered in the API keys field within the plugin settings.

Solution

Log into your PayPal business account.

  • Get API Access credential in any of the two ways:
    • Go to Activity at the top of the page and choose API Access or
    • From Account settings > API Access > View/Update.
  • Scroll down to NVP/SOAP API Integration (Classic) and click Manage API Credentials.
  • Create the credentials if they don’t exist. Alternatively, copy the following details:
    • API Username
    • API Password
    • Signature​
PayPal developer account
PayPal developer account

Next, open the plugin settings and input the copied credentials into the corresponding fields within the PayPal plugin settings.

PayPal Credentials
PayPal Credentials

2. Error Code 10565 – Merchant Country is Not Supported

This error arises when attempting direct credit card checkout, which is only available for the US, UK, and Canada due to PayPal’s restrictions.

Workaround

You can work around this limitation by disabling the direct credit card checkout feature and still using the express checkout option seamlessly.

3. Error Code 10548 – Merchant Account Cannot Process Transactions

Ensure that your merchant account has the PayPal Payments Pro feature enabled. Keep in mind that direct credit card checkout is only available for the US, UK, and Canada.

4. Error Code 10413 – Cart Item Amounts Do Not Match Order Amounts

This error commonly occurs when cart totals sent to PayPal are altered by other plugins or code on your site.

Solution

Check for plugins affecting cart totals such as discount plugins, extra fees, or shipping charge modifying plugins.

5. mod_security error

As a security practice, every page request from your website is being checked against various rules to filter out malicious requests. Sometimes, due to poor website coding, mod_security may incorrectly determine that a certain request is malicious, and disable its access while it is actually legitimate. 

Workarounds

a. Contact Your Hosting Provider

As the error is related to server-side configurations, the safest and simplest approach is to reach out to your hosting provider’s support team. Explain the issue you’re facing, and they are likely to resolve it by either disabling specific security rules causing the problem or by whitelisting the affected page.

b. Disable mod_security Using the .htaccess File

This method is not recommended as it will turn off the whole mod_security Apache module for your site, which might not be good for your site’s security.

To turn off the mod_security Apache module:

  • Back up your existing .htaccess file in the ‘wp-admin’ directory.
  • Create a new ‘.htaccess‘ file and add the following content using a text editor.
  • Upload this new ‘.htaccess‘ file to the ‘wp-admin’ directory.

If this solution doesn’t work, try the below one:

  • Back up your .htaccess file if you have one in the ‘public_html’ directory.
  • Open the .htaccess file using a text editor.
  • Add the following content to the file.
  • Upload the modified .htaccess file to the ‘public_html’ directory.

c. Disable mod_security for Specific URLs

This method offers a more security-conscious solution by selectively disabling mod_security for specific URLs. This ensures protection while still resolving the issue. Follow these steps:

  • Back up your existing .htaccess file in the ‘wp-admin’ directory.
  • Create a new ‘.htaccess‘ file and add the following content using a text editor.
  • Specify which URLs to match via the regex in the <If> statement
  • Upload this new ‘.htaccess‘ file to the ‘wp-admin’ directory.

6. “An Error Occurred During Checkout” Message

To resolve this message, ensure that you’ve entered the correct PayPal API credentials in the plugin settings. Follow these steps:

  • Go to WooCommerce > Settings > Payments > PayPal Express.
  • Enable the gateway and click on Manage.
  • Input the PayPal API credentials in the provided field.
  • To get the API credentials:
    • Log in to your PayPal business account.
    • Click on Activity near the top of the page and select API Access.
    • Scroll down to NVP/SOAP API Integration (Classic) and click on Manage API Credentials.
    • Create the credentials if needed. Otherwise, copy the API Username, API Password, and Signature, and paste them into the relevant fields in the plugin.

7. WooCommerce Orders Canceled after successful payment with “Unpaid Order Canceled – Time Limit Reached” Message

If you’ve encountered a situation where orders placed using PayPal do not complete successfully and are automatically changed to the canceled status with the message Unpaid order canceled – time limit reached. The problem stems from the Hold Stock feature in WooCommerce’s Inventory management, which can lead to orders being canceled prematurely.

The Hold Stock feature in WooCommerce inventory management allows you to specify a duration during which stock is reserved for unpaid orders. During this period, the order status changes to “pending.” If the order remains unpaid when the time limit expires, the pending order is automatically canceled. By default, WooCommerce cancels orders that stay in the pending status for one hour.

Workaround

Follow the given steps to adjust the Hold Stock settings:

  • From the WordPress dashboard, navigate to WooCommerce > Settings > Products > Inventory.
  • Here, you’ll find the Hold Stock field, which is set to 60 minutes by default.
  • To resolve the issue, disable the hold stock feature by deleting the value in the Hold Stock field, leaving it blank.
  • Save the changes.
PayPal - settings
PayPal – settings

This action ensures that there is no timeout imposed when PayPal or any other payment system attempts to process the order automatically. Normally, payments should be processed within a minute or two. Notably, PayPal and WooCommerce interactions can be problematic when the Hold Stock field has a value set. Therefore, leaving this field blank is the recommended approach to prevent order cancellation after successful PayPal payments.

8. Error message: UNPROCESSABLE_ENTITY

While using third-party plugins such as discount plugins or coupon plugins along with PayPal express payment gateway for WooCommerce, there could be an amount miss match while billing. This issue mainly arrives when the payment plugin has a compatibility issue with the third-party plugins.

Workaround

  1. Enable Subtotal Mismatch Behavior
  • From the WordPress admin dashboard, navigate to WooCommerce > Settings > Payments > PayPal Express > Manage.
  • Scroll down and Enable Subtotal Mismatch Behavior.
  • Save changes.
Subtotal mismatch behavior
Subtotal mismatch behavior
  • If the error still exists, enable Remove line item under the Subtotal Mismatch Behavior.
Subtotal mismatch behavior
Subtotal mismatch behavior
  1. Try uninstalling plugins
  • If enabling Subtotal Mismatch Behavior doesn’t work, try uninstalling the plugins that offer discounts or coupon functionality.
  • Once you identify the plugin with the compatibility issue, reach out to our support team with the plugin details.

9. Third-party plugin data missing from order details

While using PayPal express payment gateway for WooCommerce with other third-party plugins, you might encounter a situation where specific information from these third-party plugins doesn’t show up in the orders you create.

This situation mainly arises because of third-party plugin compatibility issues. With PayPal express payment gateway for WooCommerce, the orders are formed within the plugin itself. At the time, the PayPal plugin will override the WooCommerce fields. Unfortunately, the data from those third-party plugins might not be saved in the fields of the payment plugin, causing this mismatch.

Workaround

This issue can be solved with the help of a code snippet.

  • Replace the field_name with the specific name of the missing data field in the order details.
  • Replace the field_key with the corresponding database field name for which data is missing from the order details.

10. Charging more/less than the amount present on the WooCommerce site

This would be possibly a third-party conflict. To rectify this issue:

  • Deactivate all plugins and activate them one by one.
  • Once you identify the issue, reach out to the support team for assistance.

While contacting support, share:

  1. Logs of affected orders
  2. System status report
  3. Payment method

Encountering Different Errors?

If you’re facing errors not covered in this guide, please look into the list of other PayPal error codes and messages.

Seeking Further Assistance

If you continue to experience difficulties, feel free to contact our support team. Provide them with the error code and log file to receive additional help and guidance.