• Good Morning friends,

    I have a Website with Credit card and Visa Payment Gateway, in the checkout if customer chose to pay and open the form to enter his/her information then they decide to cancel they get redirected to a page to it says “Payment cancelled: Result indicator error.”.

    Can i redirect the customer to the home or shop page after they press cancel ?

    Redirect plugin did not work because the link in the cancel button is changed every time.

    Can you guys please help me, Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • There’s probably a setting for that in your eCommerce plugin or payment gateway settings. The ‘result indicator error’ may be trying to tell you that’s not set right. It’s possible the default page for that feature is missing also.

    You might ask the author of that plugin for assistance if you can’t find it. It’s not a WordPress issue as there’s no built-in eCommerce system in WordPress.

    Thread Starter sayedhussain96

    (@sayedhussain96)

    Unfortunately there isn’t an option in the plugin, That’s way i am trying to modify the code.

    This is my website: https://www.noohpharmacy.com
    and this is a website the using the same plugin and was able to modify the code : https://www.Alrifaibh.com

    Try credit card payment the press cancel to see the different.

    Moderator bcworkz

    (@bcworkz)

    Even if the link changes, isn’t there some reliable, distinct element that defines where to go even if there are other extraneous elements? There ought to be a regexp that will match that element regardless of the rest. Use that regexp in a RedirectMatch directive in .htaccess to accomplish your goal.
    https://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirectmatch

    Thread Starter sayedhussain96

    (@sayedhussain96)

    I wrote this code in the cancel button:

    "<?php echo $redirect = add_query_arg( 'order-pay', $order->get_id(), $order->get_checkout_payment_url( true ) ); ?>"

    When I click cancel it redirect me to the same page that i am in.

    I want the cancel button to redirect the customer to the cart page, I tried to modify it a bit but i didn’t have any luck.

    Moderator bcworkz

    (@bcworkz)

    If they’re cancelling and you redirect to your shop page, does the shop page really need the “order-pay” query arg? Couldn’t you just do something like <?php echo $redirect = 'https://example.com/shop/'; ?>?

    I don’t know how this echoed value is used, nor how $redirect is used, so I cannot be certain what will or will not work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect Page After Payment Is Cancelled’ is closed to new replies.