Better Organization Billing / Stripe Plugin
Is there an example for organization billing, I solved it with custom logic everywhere but was wondering if there is an easier solution as I had the issue that it created a stripe customer id for the user instead of the organization
6 Replies
Stripe | Better Auth
Stripe plugin for Better Auth to manage subscriptions and payments.
nope, in my case it still created a stripe customer id for each user instead of the organization
it's somehow related to this I guess:
https://github.com/better-auth/better-auth/issues/3772
GitHub
[STRIPE] Plugin should support stripe subscription id for organizat...
Currently the stripe subscription id is always on the user. In case of using organizations, the stripe subscription id should however be on the organization, or at least it should be possible to se...
so, what you would do is disable the auto creation of stripe customers on user sigup, and then implement an org creation hook that uses your stripe client to create a stripe customer. donezo.
I did this and the simple act of using 
authClient.subscription.upgrade causes a personal customer to be made EVEN IF referenceId is given for an org. It makes both at the same time.
I'm deeeeep in this rabbit hole, did you just essentially write it alone, outside of better-auth? That's almost where I'm at
For anyone else interested, ended up just removing the stripe plugin and using the SDK to generate portal links using the org's ID instead of the user's ID and added my own webhook endpoints to the auth server to catch. As with everything stripe, nothing's 100%, so just make sure you have some sync cron job that occasionally runs to keep your db in sync with stripe's (something that the plugin could also have added to it I suppose)Yea I am wondering if I should just handle stripe outside of better-auth,  it would be nice to have the integration but it seems like a wasps nest