Closed kschmelter13 closed 6 months ago
@kschmelter13 is attempting to deploy a commit to the Vercel Solutions Team on Vercel.
A member of the Team first needs to authorize it.
Interesting, thanks. So just to be clear, you encountered a scenario where the customer had been deleted from Supabase but not from Stripe, and this was resulting in a duplicate customer record being created in Stripe. To prevent this, you added a check for a matching record in Stripe before creating a new Stripe customer. Correct?
It looks like your code fails if the customer already exists in both supabase and stripe, because it finds a stripe record and then tries to upsert a duplicate record to supabase without checking if a supabase record exists first, which causes a primary key conflict.
I opened a new PR here: https://github.com/vercel/nextjs-subscription-payments/pull/274
Not sure if this is helpful, but i used it in my personal project to validate existing customers so it wont create duplicates, after an account is deleted