Support » Plugin: Sezzle Woocommerce Payment » PHP Fatal error in WooCommerce API callback

  • Resolved Brian Henry


    Looks like there was no order for the order key returned to the callback, but I do see the order from that time and it was successfully marked as paid.

    [18-May-2022 12:40:24 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_transaction_id() on bool in /path/to/wp-content/plugins/sezzle-woocommerce-payment/woocommerce-gateway-sezzle.php:633
    Stack trace:
    #0 /path/to/wp-includes/class-wp-hook.php(307): WC_Gateway_Sezzlepay->sezzle_payment_callback('')
    #1 /path/to/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #2 /path/to/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #3 /path/to/wp-content/plugins/woocommerce/includes/class-wc-api.php(161): do_action('woocommerce_api...')
    #4 /path/to/wp-includes/class-wp-hook.php(307): WC_API->handle_api_requests(Object(WP))
    #5 /path/to/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #6 /path/to/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
    #7 /path/to/wp-includes/class-wp.php(396): do_action_ref_array('parse_request', Array)
    #8 /path/to/wp-includes/class-wp.php(758): WP->parse_request('')
    #9 /path/to/wp-includes/functions.php(1310): WP->main('')
    #10 /path/to/wp-blog-header.php(16): wp()
    #11 /path/to/index.php(17): require('/chroot/home/ab...')
    #12 {main}
      thrown in /path/to/wp-content/plugins/sezzle-woocommerce-payment/woocommerce-gateway-sezzle.php on line 633

    which is inside (abbreviated):

    function sezzle_payment_callback() {
      $_REQUEST = stripslashes_deep($_REQUEST);
      $order_key = $_REQUEST['key'];
      $order_id = wc_get_order_id_by_order_key($order_key);
      $order = wc_get_order($order_id);
      $sezzle_reference_id = $order->get_transaction_id();

    which is on the action:

    add_action('woocommerce_api_' . strtolower(get_class($this)), array($this, 'sezzle_payment_callback'));

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sezzle


    This is really weird. Can you share with us the order id and merchant uuid?

    Thread Starter Brian Henry


    Merchant id, transaction id, order key, order id:


    We’ve had Sezzle orders since with no error logged. And I keep a reasonable eye on the logs and I don’t recall seeing this before.

    The plugin version was 4.0.4 at the time, but I don’t see anything in the changes that would be relevant.

    Plugin Author Sezzle


    I don’t know why this has happened but I can also see that the payment was captured at our end and shows completed at our end.

    And, do u see Payment approved by Sezzle successfully note in the Order Notes for this order?

    Thread Starter Brian Henry


    Yes, everything looks normal on the order itself:

    Payment approved by Sezzle successfully.
    May 18, 2022 at 5:40 am
    Plugin Author Sezzle


    Perfect. Then, it could be of some disconnection or user manipulation error.
    Let us know if you see similar issues in the future, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Fatal error in WooCommerce API callback’ is closed to new replies.