Closed soyondori closed 1 week ago
It seems that is related to Bandit; which I havent use it myself, I am on vacation until Sep 25th, so I am not able to help here until then.
Please create a PR if possible.
This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet. If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.
Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!
Existing Issue or Pull Request Verification
Package Version
3.2.0
Are you using the latest version?
Steps to Reproduce
I'm encountering an issue where Stripe webhooks are failing in my local environment but weirdly they are working fine in production. The webhooks are forwarded through the Stripe CLI using the listen command.
Environment
Bandit version: 1.5.7 Phoenix version: 1.7.14 Elixir version: 1.16.1 Stripe API version: 2024-04-10
Plug Config
Handler
Stripe CLI Commad
Expected Result
I'd expect to receive the events without any trouble.
Actual Result
I get the following error:
I inspected the headers and the JSON payload of the webhook, and everything seems correct:
Here is a part of the JSON payload being sent by Stripe:
Additional Information:
🛑 I attempted to switch from Bandit to Cowboy in the phoenix adapter, but the webhook still failed with a 400 status code.
✅ I configured a standard Phoenix endpoint to handle the webhook (instead of using the Stripity Stripe plug), and in this case, the webhook was successfully received.
As weird as it sounds, this problem is not happening in my prod environment even when I'm using the same deps versions and the same stripe api version.