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: PHP Notice: Trying to get property 'id' of non-object in wp-content/plugins/give-recurring/src/Webhooks/Stripe/Listeners/CustomerSubscriptionCreated.php on line 33 #7688

Open
pulsovi opened this issue Jan 23, 2025 · 0 comments
Labels
type: bug Existing functionality is broken

Comments

@pulsovi
Copy link
Contributor

pulsovi commented Jan 23, 2025

User Story

I found this error in my site log.

Details

PHP Notice: Trying to get property 'id' of non-object in wp-content/plugins/give-recurring/src/Webhooks/Stripe/Listeners/CustomerSubscriptionCreated.php on line 33

According to my analysis, the problem comes from the expected return type of the CustomerSubscriptionCreated@getSubscription method.

CustomerSubscriptionCreated@processEvent seems to assume that it will necessarily be a Give_Subscription.

While parsing the function, it sometimes returns the result of a call to give_recurring_get_subscription_by.

And this last function specifies a return @return bool|Give_Subscription.

The type @var bool $subscription is not expected by the function CustomerSubscriptionCreated@processEvent hence our error...

@pulsovi pulsovi added the type: bug Existing functionality is broken label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Existing functionality is broken
Projects
None yet
Development

No branches or pull requests

1 participant