• Resolved Famish

    (@iclicknz)


    Hi Team,

    I’m having issues with Stripe declined cards as the delivery fee gets $0 after a card is declined. The user can then pay again for $0 delivery with the correct card details.

    I wish to redirect users to a different page when a card is declined.

    I already tried the following code but the page doesn’t redirect. Just shows this error: https://ibb.co/cTzjvLm

    function stripe_redirect_declined_card( $order_id ){
    global $woocommerce;
    $order=new WC_Order($order_id);
         if ( $order->has_status( 'failed' ) ) {
           header('Location: https://domain.com.au/failed-payment/');
         }
    }
    add_action( 'woocommerce_thankyou','stripe_redirect_declined_card',10,1);

    Could someone please assist me in this regard?

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    We haven’t heard back from anyone in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect after card delined’ is closed to new replies.