dj-stripe / dj-stripe

dj-stripe automatically syncs your Stripe Data to your local database as pre-implemented Django Models allowing you to use the Django ORM, in your code, to work with the data making it easier and faster.
https://dj-stripe.dev
MIT License
1.56k stars 474 forks source link

Having multiple projects breaks the webhook #2054

Closed jTiKey closed 1 week ago

jTiKey commented 1 week ago

Describe the bug Webhook breaks if there's multiple projects registered to the account.

To Reproduce Have project A and project B.

Ignore project A, add project B API keys. Manually sync. It will automatically add project A secret(!!!!!!!!) api key (why does it even do that?). Now try to add a product in project B - the webhook will return "Product doesn't exist" error. Where I suspect it tried to check for the product on project A instead of B.

Software versions

jTiKey commented 1 week ago

EDIT: Turns out STRIPE_TEST_SECRET_KEY was using the Project A keys so it would do weird stuff. Please either have the env keys have the key or the db.