Integrating stripe connect into convex
My app idea is to be able to go to a user, and if they have signed their financial details up through stripe, I can donate to them. The user gets a percentage as does the platform. The question is how would i go about approaching this with convex?
4 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
I've found good results asking questions like this to an LLM 🙂
And as I'm answering this I see the #ask-ai channel may do this automatically!
I've already done this, however I cannot trust LLMs for something like this where there is financial data involved.
I already have a payments.ts:
as well as webhook endpoints in my http.ts
I also have a creator_payments table:
creatorpayments: defineTable({
userId: v.id("users"),
stripeConnectId: v.optional(v.string()), // acct...
payoutsEnabled: v.boolean(),
stripeConnectStatus: v.union(
v.literal("not_started"),
v.literal("requirements_due"),
v.literal("pending_verification"),
v.literal("active"),
v.literal("restricted")
),
detailsSubmittedAt: v.optional(v.number()),
country: v.optional(v.string()),
defaultCurrency: v.optional(v.string()),
lastWebhookEventId: v.optional(v.string()),
createdAt: v.number(),
updatedAt: v.number(),
})
.index("by_user", ["userId"])
.index("by_status", ["stripeConnectStatus"])
.index("bypayouts", ["payoutsEnabled"])
and a tips table:
tips: defineTable({
paymentIntentId: v.string(), // pi...
chargeId: v.optional(v.string()), // ch... (from webhook)
applicationFeeId: v.optional(v.string()), // fee... (from webhook)
tipperId: v.id("users"), // who paid
creatorId: v.id("users"), // who receives
recipeId: v.optional(v.id("recipes")), // optional attribution
amount: v.number(), // minor units
currency: v.string(), // 'gbp', 'usd', ...
platformFee: v.number(), // minor units (50%)
creatorPayout: v.number(), // amount - platformFee
status: v.union(
v.literal("processing"),
v.literal("succeeded"),
v.literal("failed"),
v.literal("refunded"),
v.literal("disputed")
),
createdAt: v.number(),
updatedAt: v.optional(v.number()),
})
.index("by_payment_intent_id", ["paymentIntentId"])
.index("by_creator_id", ["creatorId"])
.index("by_tipper_id", ["tipperId"])
.index("by_recipe_id", ["recipeId"])
.index("by_status", ["status"])
.index("by_created_at", ["createdAt"]),
Btw to scaffold most of this(becasue right now im doing exploratory tesitng) I used o3 and claude sonnet 4, but LLMs cannot give me the confidence that someone with experience in stripe can