-
Notifications
You must be signed in to change notification settings - Fork 9
feat: integrate Stripe for subscription management and update schema #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Updating subscriptions will fail currently due to lack of "OR" operator support in the adapter, I'm working on this today.
@@ -19,5 +19,5 @@ jobs: | |||
cache: "npm" | |||
- run: npm i | |||
- run: npm ci | |||
- run: cd example && npm i && cd .. | |||
# - run: cd example && npm i && cd .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because the CI completely fails, since there is no "example" directory. I guess in there there should be the generate command maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, we have a bunch of examples. Need to fix this.
@@ -179,6 +179,10 @@ export const convexAdapter = ( | |||
if (!("runMutation" in ctx)) { | |||
throw new Error("ctx is not a mutation ctx"); | |||
} | |||
if (data.where?.[0] && !data.where?.[0]?.operator) { | |||
data.where![0].operator = "eq"; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The adapter should use eq as default, curious if this change is addressing a failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to check. I think the issue I was facing was because we weren't passing the "where" when getting a user, which would always return the oldest one, instead of the requested one.
Integrated the Stripe plugin beta for better-auth.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.