#NormanLove
1 messages ยท Page 1 of 1 (latest)
hello! can you share more details?
sure. first its great to see you and happyt holydays ๐
happy holidays to you too!
So I have the code from a stripe payments thing I did like a year ago, so I have the working code I did and webhooks.php code should be tight as it was on a production site which worked. its just my logic NOW which may be blurry. So I need to test the webhooks.php file, and i choose to do the testing local, so I have the stripe client in place. I have it listening to ./stripe listen --forward-to localhost/producerswork.com/webhook.php , and it seems to be working. It gets all 200 http responses and all, but the php code in webhooks.php is not firying when customer.subscription.cancelled is fired, and it should. I fired off the evevent in another window
./stripe trigger customer.subscription.deleted
Setting up fixture for: customer
Running fixture for: customer
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: subscription
Running fixture for: subscription
Setting up fixture for: subscription_deleted
Running fixture for: subscription_deleted
Trigger succeeded! Check dashboard for event details.
so all is green and good, but ithe events are not triggering the function its supposed to, I have error logs inside them, as you can see and NO logs inside the events. I just see the logs at top BEFORE the events switch, and the FINAL response at the end, the catch all. what am I missing?
here is full webhook.php code:
if you echo $event->type just before error_log("leg 3");, what do you get?
ok, I figured out something. I have an IF statement that was NOT being met. line 71 if (activeUser($subscription->customer)){
thats my internal table checking if customer exists and is active, which the customerID is not because itsa local fake test. I set this so that the webhook would only happen IF the user was present and ACTIVE, So I actually have to add the user added,. See you still helped me figure it out. Just you being around helped ๐