• Resolved miroslavps

    (@miroslavps)


    Hi guys!

    I am testing a third party payment plugin on WC 9.0.2 and looks like the Zero Total orders do not go throw process_payment method (overridden from WC_Payment_Gateway class).

    Is this the new normal behavior? Any directions how to avoid this “problem” are welcome.

    Regards!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there, @miroslavps! Thanks for contacting us.

    Do you mind sharing more details about the issue you are facing?

    What steps do you take that trigger the issue?

    Also, which payment plugin are you testing? Have you contacted their support regarding this? ??

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter miroslavps

    (@miroslavps)

    Thanks for the answer!

    I am not sure what other details to provide. I test with same product. First I put some price bigger than 0, so the Total is also bigger. I finish the order and the process goes go through process_payment(). There is a logger function in the method.

    Then change the price of the same product to 0, use free shipping, so the Order total is 0, finish the order and there is no logged message from process_payment(). I mark this as failed test because I save some custom data in the Order in process_payment(), which I use later.

    Same test passed may be a month or less ago with WC 8.9.*. So instead of guessing I decide to ask directly is there any change in WC 9.0.1 or 9.0.2 who skip process_payment() when the order has total 0.

    Regards!

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miroslavps

    The process_payment() method is not triggered for orders with a total of 0 because there’s no actual payment to process.

    If you need to save some custom data in the order when the total is 0, I would recommend using the woocommerce_new_order action hook. This hook is triggered whenever a new order is created, regardless of the total.

    Please note that writing or providing custom code is not within the scope of our support policy. If you are still having problems, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter miroslavps

    (@miroslavps)

    Thank you!

    I just needed to know if my observations are correct.

    Regards!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Zero Total Order and process_payment method’ is closed to new replies.