• Resolved ltrost

    (@ltrost0910gmail)


    What hook is fired after successful payment is complete? This snippet seems to confirm that this is not being fired after it worked.

    add_action(‘woocommerce_payment_complete’, function ($order_id) {
    error_log(“TESTING woocommerce_payment_complete triggered for order #$order_id”);
    });

    Further testing reveals:

    My setup requires that I have orders set to Processing (to allow downloads and other things for virtual products) if the customer has chosen Cash as the gateway. I have made adjustments so that later they can go to use the Pay Now button if they want to change to pay online instead. When using that option, since the order is already in Processing, no payment_complete is fired, so the order is never changed to completed. Is there a different hook I can look at to see if payment was completed?

    I resolved this by using the woocommerce_before_pay_action to change the order to on-hold, then it seems to work.

    • This topic was modified 11 months, 1 week ago by ltrost.
    • This topic was modified 11 months, 1 week ago by ltrost.

The topic ‘Advanced Card Processing payment complete hook’ is closed to new replies.