Closed danosterhout closed 1 month ago
Came to report the same issue. Plugin version is 2.7.1. PHP 8.2.19.
For use, this error is triggered when we export order updates from ShipStation, and is causing the tracking to added to the order multiple(sometimes dozens of) times.
For those looking for a quick fix: open file modules/ppcp-order-tracking/src/Integration/ShipmentTrackingIntegration.php and add this code at about line 86:
$payment_method = $wc_order->get_payment_method();
if ($payment_method != 'ppcp-gateway') {
return;
}
It should look like this:
$order_id = (int) wc_clean( wp_unslash( $_POST['order_id'] ?? '' ) );
$wc_order = wc_get_order( $order_id );
if ( ! is_a( $wc_order, WC_Order::class ) ) {
return;
}
//the new code
$payment_method = $wc_order->get_payment_method();
if ($payment_method != 'ppcp-gateway') {
return;
}
//end
$paypal_order = ppcp_get_paypal_order( $wc_order );
$capture_id = $this->get_paypal_order_transaction_id( $paypal_order );
Hi folks, thanks for the issue report, and I apologize for the trouble. This error was resolved in https://github.com/woocommerce/woocommerce-paypal-payments/pull/2289. It can be worked around either with a temporary downgrade to version 2.7.0 or by installing the latest pre-release version for the upcoming 2.8.0 update.
If you need additional guidance on how to resolve the error, I recommend contacting our support team directly from here: https://woocommerce.com/document/woocommerce-paypal-payments/#get-help Thank you!
[05-Jun-2024 23:35:32 UTC] PHP Fatal error: Uncaught InvalidArgumentException: PayPal order ID not found in meta. in /wp-content/plugins/woocommerce-paypal-payments/api/order-functions.php:38 Stack trace:
0 /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-order-tracking/src/Integration/ShipmentTrackingIntegration.php(88): WooCommerce\PayPalCommerce\Api\ppcp_get_paypal_order('')
1 /home/dollar42/d3creation.com/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\OrderTracking\Integration\ShipmentTrackingIntegration->WooCommerce\PayPalCommerce\OrderTracking\Integration{closure}('')
2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
3 /wp-includes/plugin.php(517): WP_Hook->do_action(Array)
4 /wp-admin/admin-ajax.php(192): do_action('wp_ajax_wc_ship...')
5 {main}
thrown in /wp-content/plugins/woocommerce-paypal-payments/api/order-functions.php on line 38