[ad_1]
When developing and using Stripe’s test mode, if Stripe returns an error code 402 (Declined Card), the plugin automatically displays the corresponding error message to the user. However, after switching to production mode and using the live Stripe API key, these error messages are no longer displayed.
Symptoms:
- In test mode, when entering a test card that results in a 402 error, the user is shown the corresponding error message.
- In live mode, when entering a test card, the user simply sees a loading screen without any error messages.
- Stripe settings are identical for both test and production modes.
- The browser console shows an error “Failed to load resource: the server responded with a status of 402 ()” indicating a 402 error from Stripe.
Environment Details:
- WordPress Version: 6.4.3
- Stripe Plugin: Gravity Forms Stripe Add-On – Version 5.1.0 | WooCommerce Stripe Gateway – Version 8.2.0
- PHP Version: 8.1
Steps to Reproduce:
- Go to the checkout page in live mode.
- Enter a Stripe test card that results in a 402 error (e.g., 4000000000000341).
- Observe the absence of an error message and an infinite loading screen.
Expected Behavior: After entering a test card that results in a 402 error, the user should be shown the corresponding error message, just as it happens in test mode.
