Conversation
supportOn my checkout page, the razorpay payment gateway is not loading when this plugin is enabled When plugin disabled: https://pasteboard.co/JoiRm2p6eiic.png When enabled: https://pasteboard.co/T1H9W5PIi6b2.png
Hi @pbayad1974 , Thanks for reaching out. It appears that the third-party payment gateway plugin is trying to retrieve the order using the order number. Normally, in WooCommerce, the order number and order ID are the same. However, when using the Sequential Order Numbers plugin, the order number is customised and no longer matches the internal WooCommerce order ID. Because the third-party payment gateway plugin expects the order number to be the same as the order ID, it fails to retrieve the correct order object, causing a fatal error when trying to process payment. To make it compatible with the plugin, we recommend that the third-party payment gateway plugin update its implementation in either of the following ways: If they need to work with the order number, they may use the following snippet to retrieve the order object from the sequential number: function getOrder( $order_number ) { $orders = wc_get_orders([ 'limit' => 1, 'meta_key' => '_order_number', 'meta_value' => $order_number, 'meta_compare' => '=' ]); return ! empty( $orders ) ? $orders[0] : false; } Use $order->get_id() instead of $order->get_order_number() throughout the payment flow. This ensures they always retrieve the correct order regardless of any formatting applied. This change needs to be made by the third-party payment gateway plugin developers, as it affects how their system retrieves and handles WooCommerce order data. Please feel free to forward this explanation and code snippet to their support team for implementation.
Hi @pbayad1974 , Thanks for reaching out. It appears that the third-party payment gateway plugin is trying to retrieve the order using the order number. Normally, in WooCommerce, the order number and order ID are the same. However, when using the Sequential Order Numbers plugin, the order number is customised and no longer matches the internal WooCommerce order ID. Because the third-party payment gateway plugin expects the order number to be the same as the order ID, it fails to retrieve the correct order object, causing a fatal error when trying to process payment. To make it compatible with the plugin, we recommend that the third-party payment gateway plugin update its implementation in either of the following ways: If they need to work with the order number, they may use the following snippet to retrieve the order object from the sequential number: function getOrder( $order_number ) { $orders = wc_get_orders([ 'limit' => 1, 'meta_key' => '_order_number', 'meta_value' => $order_number, 'meta_compare' => '=' ]); return ! empty( $orders ) ? $orders[0] : false; } Use $order->get_id() instead of $order->get_order_number() throughout the payment flow. This ensures they always retrieve the correct order regardless of any formatting applied. This change needs to be made by the third-party payment gateway plugin developers, as it affects how their system retrieves and handles WooCommerce order data. Please feel free to forward this explanation and code snippet to their support team for implementation.