Skip to main content

Stripe Failed Payment Notices

Goal​

Show users clear, customizable error messages when a Stripe payment fails (e.g. card declined, expired card, incorrect CVC). Use the %%membership_messages%% merge tag and configure messages in settings.

Where to configure error messages​

Go to Divi Engine → Divi Membership → Payment Gateways (Stripe section / Stripe Options). There you can modify the default text for each error type. Use Stripe’s testing documentation to simulate declined cards and other errors in test mode.

Displaying messages on the page​

Use the %%membership_messages%% merge tag on the page where users are redirected after a failed payment. That tag outputs the specific error message (e.g. “Sorry, your card is declined.”).

Registration Form (Divi 5)​

Open the module's Content → Advanced settings:

  1. Set Redirect Type for Failed Payment to Page or URL.
  2. For Page, select Redirect Page for Failed Payment. For URL, enter Redirect URL for Failed Payment.
  3. Add %%membership_messages%% to a Text module on that destination.
  4. Save both pages, submit a Stripe test card that fails, and confirm the destination shows the configured message.

The Divi 4 Register module provides the equivalent failed-payment redirect controls.

Signup Form​

The Signup Form does not provide the Registration Form's failed-payment redirect fields. It displays failures during its own payment flow; do not expect it to use the Registration Form destination. You can place a Signup Form on a separate retry page, but the failed Registration Form must be configured to redirect there and the page should include %%membership_messages%%.

Default messages (examples)​

Error typeDefault message
Declined card (card_declined)"Sorry, your card is declined."
Expired card (expired_card)"Sorry, your card is expired."
Incorrect CVC (incorrect_cvc)"Sorry, the CVC for your card is incorrect."
Processing error (processing_error)"There was an issue with processing your payment, please try again."
Incorrect number (incorrect_number)"Your card number is incorrect."
Invalid expiry month/yearMessages direct the user to check the expiration date or use a different card.

Customize each in Divi Engine → Divi Membership → Payment Gateways (Stripe Options).

What's Next​