• Hello,

    We are facing a problem while using your payment gateway with WooCommerce Deposits, a premium WooCommerce plugin for handling deposits at checkout.

    It seems when customer switches to deposits, your payment gateway can’t handle the order details. Please see this video: https://streamable.com/kpau2u

    We contacted the deposits plugin developers and they mentioned that it is something related to your plugin while handling order details, here is their full response:

    Hello Mahmoud,

    It seems there was a misunderstanding. When I mentioned WC_Order($order_id), I was referring to the fact that MyFatoorah is using new WC_Order($order_id), which is not the recommended approach. The correct way to retrieve an order in WooCommerce is by using wc_get_order($order_id).

    Using new WC_Order($order_id) directly can cause issues because it bypasses WooCommerce’s internal caching and hooks, which are necessary for handling deposit-related metadata properly. Any fix from our side won’t resolve issues caused by MyFatoorah’s internal code. The wc_get_order($order_id) function is the standard approach used by major gateways like PayPal, Stripe, and others to ensure proper order handling.

    Thank you!

    https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-order-functions.html

    https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query

    Thank you for looking into this! I appreciate your help and look forward to your update.

    The page I need help with: [log in to see the link]

The topic ‘WC_Order($order_id)’ is closed to new replies.