protonemedia / laravel-paddle

Paddle.com API integration for Laravel with support for webhooks/events
https://protone.media/en/blog/a-new-laravel-package-to-handle-payments-and-subscriptions-with-paddle
MIT License
203 stars 18 forks source link

Return HTTP response #30

Closed BenBornschein closed 2 years ago

BenBornschein commented 2 years ago

At the moment the only way to not return a HTTP 200 code is by throwing an Exception and exposing a stacktrace to the requester, which I am not a fan of.

But not returning a HTTP 200 code is essential when you want Paddles event system to fire an event again at a later point, for example when you need the subscription_created data before you can handle the subscription_payment_succeeded request.

Is there any other option? At the moment I don't see an option because WebhookController doesn't responds to the request.

Edit: https://laravel.com/docs/9.x/errors#renderable-exceptions that's the solution.