$order is null when incoming webhook is in Live mode
-
Hi there!
I’m having a problem with the plugin in “Live” mode, specifically ACH payments.
For some reason, the order status is not being switched to processing/complete when the payment success intent is sent to the website.
I was able to track down the issue to this exact function: https://gist.github.com/Babylon1999/53d76745785eff3a894db0747d9cbd5b
The function is stopped atif ( ! $order )
and throws the related error, however, the$intent->metadata->order_id
returns the true order ID and is thrown in the error.2024-02-13T21:18:16+00:00 INFO Webhook notification received: Event: payment_intent.succeeded 2024-02-13T21:18:16+00:00 INFO Could not complete payment_intent.succeeded event for payment_intent pi_TEST. No order ID 14924 was found in your WordPress database. This typically happens when you have multiple webhooks setup for the same Stripe account. This order most likely originated from a different site.
I thought this might have to do with HPOS, but no, the behavior is consistent. What’s driving me crazy is when I log the
$order
value in test mode I get the correct data, also the order status is changed correctly.Here’s the response from the server: https://i.imgur.com/U3tOkLp.png
As you can see, there are no errors whatsoever, only an empty array response.I would really appreciate any assistance on how to solve this. ??
Here’s a copy of the site’s system status (had to redact some data as it’s a client website).
- The topic ‘$order is null when incoming webhook is in Live mode’ is closed to new replies.