-
Notifications
You must be signed in to change notification settings - Fork 207
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
9.1.1: WC_Stripe_Webhook_Handler: Cannot use object of type stdClass as array #3721
Comments
WP 6.7.1, WC 9.5.2, Stripe Gateway 9.1.1, PHP 8.2 For context, we had this issue occurring when using a donation form at checkout, and the webhook responding to the donation payment didn't return an Order object (same error message). Disabling the donation plugin used (can't remember the exact name) and not having donations on checkout solved the issue. The code above seems to assign an empty array as default and then tries to get metadata from that, which would explain the fatal error... Thanks in case it helps, a log of the error from a staging siteERROR: PHP Fatal error: Uncaught Exception: Cannot use object of type stdClass as array
stripe webhook event data for payment_intent.succeededjson, redacted
stripe webhook logged response to event dataHTTP status code: 500 (Internal Server Error) response (json) with the same error log (18 lines traced) as above
|
Describe the bug
Since 9.1.0 I see a fatal error "Cannot use object of type stdClass as array".
The 9.1.1 release notes contain a bullet indicating this should be fixed: "• Fix - Fixes the webhook order retrieval by intent charges. The processed event is an object, not an array."
However, I still see the fatal errors in the webhook handler:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No fatal error.
Screenshots
N/A
Environment (please complete the following information):
Additional context
First instance of this error was 2025-01-10T12:09:43+00:00, after the 9.1.0 update. The log above definitely happened after the 9.1.1 update that purports to fix the issue. The specific code referenced in the stack trace is:
This looks like the commit that attempted to fix this issue: b1b5c8f
The text was updated successfully, but these errors were encountered: