#Vinny GG

1 messages · Page 1 of 1 (latest)

proper sphinxBOT
kindred rapids
#

hi! what's the exact error and context?

eager forum
#

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

kindred rapids
#

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?

eager forum
#

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

kindred rapids
#

well the error seems clear enough. That Lavarel object doesn't have a conversion to a string

eager forum
#

For me it is not clear, why this only occurs in this type of event?

kindred rapids
#

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

eager forum
#

you corrected it right

#

I'm testing it now and I can't simulate the error anymore, it's working

eager forum
#

this works on localhost on local listeners webhook,
now in production still with this error

kindred rapids
#

maybe the code was not saved/deployed/updated on the production server?

eager forum
#

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)

kindred rapids
#

these are all errors in your own code so I'm not sure what input you'd like me to give

eager forum
kindred rapids
#

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