#Vinny GG
1 messages · Page 1 of 1 (latest)
hi! what's the exact error and context?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
error message
Error: Object of class Laravel\Cashier\Events\WebhookReceived could not be converted to string in file /var/www/html/app/Listeners/StripeEventListener.php on line 30
have you debugged this 'StripeEventListener.php' file of yours to see what it's doing on that line and why it might throw that error?
this only occurs when I perform the action of canceling a subscription.
is the customer.subscription.deleted event
I'm saving it in the log
well the error seems clear enough. That Lavarel object doesn't have a conversion to a string
For me it is not clear, why this only occurs in this type of event?
you could remove the line(since it is just a log) or maybe change it to . json_encode($event); and see if that works, or something like that
no idea
I'll try
you corrected it right
I'm testing it now and I can't simulate the error anymore, it's working
this works on localhost on local listeners webhook,
now in production still with this error
maybe the code was not saved/deployed/updated on the production server?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
take a look
Error message
App\Actions\Billing\Downgrade\ReleaseSubscriptionActiveSchedulesAction::execute(): Argument #1 ($subscription) must be of type Laravel\Cashier\Subscription, null given, called in /home/hotspotty-v2-api/webapps/hotspotty-v2-staging-api-dan/app/Listeners/StripeEventListener.php on line 324 (500 Internal Server Error)
these are all errors in your own code so I'm not sure what input you'd like me to give
so $subscription is null
you need to add logs and debug that code then! it implies that database query (Subscription:where) is not returning you anything
maybe because you deleted the subscription from the database? you are handling a customer.subscription.deleted event after all