PHP Fatal error in WooCommerce API callback
-
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)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘PHP Fatal error in WooCommerce API callback’ is closed to new replies.