Home › Forums › Stripe Payments Plugin › dedicated error page?
Tagged: error page
- This topic has 2 replies, 2 voices, and was last updated 6 years, 4 months ago by Admin.
-
AuthorPosts
-
June 6, 2018 at 7:36 pm #1025AdminKeymaster
Hi,
My “Thank you!” page (i.e. “stripe-checkout-result”) has a big “Thank you for your payment!” title, and a few extra lines of text with additional information added before and after the [accept_stripe_payment_checkout] shortcode.
If an error occurs and the payment fails, this looks now real funny under the “Thank you” header and with information about the error nested between text that is now completely out of context… Is there a way to redirect to another, dedicated error page when an error occurs?
June 6, 2018 at 10:56 pm #1027alexanderfoxcParticipantHi Jorg.
This can be achieved via a little trick. You can rename your page to “Checkout results”. Then, you can construct your own thank you and error messages using this guide https://s-plugins.com/customize-the-thank-page-message-of-stripe-payments-plugin/
So, very basic example. Here’s how the content of your page should look like:
[accept_stripe_payment_checkout] Thank you for purchasing the following item: {item_name} You paid {item_price} {currency_code} [/accept_stripe_payment_checkout] [accept_stripe_payment_checkout_error] There was an error with the credit card transaction. Error details below: {error_msg} [/accept_stripe_payment_checkout_error]
If there were no error during the checkout, the content of [accept_stripe_payment_checkout_error] won’t be displayed. And vise versa – if there is an error, only its content will be displayed, but content inside [accept_stripe_payment_checkout] won’t be.
June 7, 2018 at 5:07 pm #1029AdminKeymasterThanks a lot, this makes sense. I have implemented this as follows:
[accept_stripe_payment_checkout] [accept_stripe_payment_checkout_error] There was an error with the payment transaction: {error_msg} Please try again. [/accept_stripe_payment_checkout_error]
But when I try this with one of Stripe’s test numbers (4000000000000341), the [accept_stripe_payment_checkout] shortcode itself also returns a message, namely
“System was not able to complete the payment. Your card was declined.”
This now duplicates the error message that follows just after:
“There was an error with the payment transaction:
Your card was declined.
Please try again.”Is there a way to silence the output from [accept_stripe_payment_checkout]?
Note that I cannot use the enclosing form “[accept_stripe_payment_checkout] … [/accept_stripe_payment_checkout]” because I am using the asp_stripe_payments_checkout_page_result filter hook to generate a custom message (which is only displayed when using the self-closing shortcode).
Thanks,
Jorg -
AuthorPosts
- You must be logged in to reply to this topic.