When adding a tracking number using the plugin WooCommerce Shipment Tracking the request fails. The tracking will be added, but the request results in a 500 error. This is because the "wp_ajax_wc_shipment_tracking_save_form" hook is fired by the plugin. When the order has not been paid, then an exeption with "PayPal order ID not found in meta." is thrown.
To Reproduce
Go to a order that has NOT been paid using PayPal
Add a tracking number
See error in network tab of browser
Screenshots
Expected Behavior
A tracking code is added without an error for orders that are not paid using PayPal
Actual Behavior
A tracking code is added with an error for order that are not paid using PayPal
Environment
Wordpress: 6.5.3
WooCommerce: 8.8.3
WooCommerce Shipment Tracking: 2.4.5
WooCommerce PayPal Payments: 2.7.1
Browser: Does not matter
Additional Details
It is possible that an order is not paid using PayPal, therefore I think the function should check that the order has been paid using PayPal before syncing the tracking details.
Describe the Bug
When adding a tracking number using the plugin WooCommerce Shipment Tracking the request fails. The tracking will be added, but the request results in a 500 error. This is because the "wp_ajax_wc_shipment_tracking_save_form" hook is fired by the plugin. When the order has not been paid, then an exeption with "PayPal order ID not found in meta." is thrown.
To Reproduce
Screenshots
Expected Behavior
A tracking code is added without an error for orders that are not paid using PayPal
Actual Behavior
A tracking code is added with an error for order that are not paid using PayPal
Environment
Additional Details
It is possible that an order is not paid using PayPal, therefore I think the function should check that the order has been paid using PayPal before syncing the tracking details.
The error has been caused by the following commit in file ShipmentTrackingIntegration: https://github.com/woocommerce/woocommerce-paypal-payments/commit/068142ac2faaaf4315d2265a8203df29416a0e17