I am handling a webhook for failed payments and the webhook is being successfully called. However, from the Laravel documentation it appears that a subscription would be automatically cancelled after 3 failed payments. In my case it is not being cancelled.
Is it because I have overridden the inbuilt behaviour? Or have I missed a trick?
Here is my webhook code:
public function handleChargeFailed(array $payload)
{
//first log the event in full
Log::info('Charge Failed - StripeWebhook - handleChargeFailed()', ['details' => json_encode($payload)]);
$tenant = Tenant::where('stripe_id', $payload['data']['object']['customer'])->first();
Mail::send(
//...//
});
return new Response('Webhook Handled', 200);
}