0

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);

}

dmulter
  • 2,608
  • 3
  • 15
  • 24
Jonathan Hyams
  • 121
  • 1
  • 2
  • 14

1 Answers1

0

I have solved it myself - in case anyone else has the same issue. Once you handle a webhook yourself you need to completely handle it. In other words you have overridden completely the default inbuilt handling.

Jonathan Hyams
  • 121
  • 1
  • 2
  • 14