Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error log ... /order-functions.php:38 #2318

Closed
danosterhout opened this issue Jun 5, 2024 · 3 comments
Closed

error log ... /order-functions.php:38 #2318

danosterhout opened this issue Jun 5, 2024 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@danosterhout
Copy link

danosterhout commented Jun 5, 2024

[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

@dream-encode
Copy link

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.

@webdev1404
Copy link

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 );

@InpsydeNiklas InpsydeNiklas added the duplicate This issue or pull request already exists label Jun 6, 2024
@InpsydeNiklas
Copy link
Member

Hi folks, thanks for the issue report, and I apologize for the trouble. This error was resolved in #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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants