• Resolved starnetwork

    (@starnetwork)


    Hello,
    I try to update Woocommerce about failed transaction from iframe / redirect payment page, but it’s look like we sending the data late and getting success URL, after page refresh it’s show the failed text

    
    <a href="https://github.com/woocommerce/woocommerce/blob/master/templates/checkout/thankyou.php" rel="noopener" target="_blank">https://github.com/woocommerce/woocommerce/blob/master/templates/checkout/thankyou.php</a>
    
    putting this code:
    $order->update_status('failed');
    $order->add_order_note('SmartPay+ payment failed');
    at:
    add_action('woocommerce_before_thankyou', [&$this, 'smartpayplus_process_order'], 1, 1);
    
    I did var_dump to order status and it's show the right status(failed) and 
    $order->has_status( 'failed' ) is TRUE
    

    but checkout/order-received show success text, after refresh it’s show the correct failed text, maybe we should use another hook to put the failed status earlier?
    what is the right function?

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Payment failed URL show success order’ is closed to new replies.