Stripe payment succeeded but the user is still on the Free plan
Updated · by Zane
Why a successful payment does not upgrade anyone
Paying and upgrading are two different steps. The payment happens on Stripe. Your app only learns about it when Stripe sends a webhook, which is a request from Stripe to a URL you gave it. For Checkout, the event is checkout.session.completed.
The success page and the "Payment successful" toast prove nothing. Anyone can open a success URL.
The chain has five links: Checkout, webhook delivery, signature check, database write, and your app reading the new plan. When money was taken and nobody was upgraded, one of the middle three is broken. I recorded this exact failure and its fix in a video on the home page.
Step 1: look at the evidence in Stripe
- Open the Stripe Dashboard, then Developers, then Webhooks. Some accounts show this under Workbench.
- Check that the test/live switch matches the payment.
- Click your endpoint, find the event, and read the response code.

What you see sends you to one of three cases. For cases 2 and 3 you also need your function's own log. In Supabase that is Edge Functions, then your function, then Logs.
Case 1: no endpoint, or no delivery at all
Stripe never reached your app. The usual reasons:
- There is no webhook endpoint.
- The endpoint points at a preview or local address.
- The endpoint was set up in test mode only. Test and live mode have separate endpoints and separate signing secrets.
Create the endpoint in the mode where the payment happened. Use the URL of your deployed function and subscribe it to checkout.session.completed. Then copy its signing secret into your app. A new endpoint has a new secret, so case 2 is the next thing to check.
Case 2: response 400 and a signature error
Your function rejected the request. In my demo project the log shows this line. The part after the colon is Stripe's own error text, so yours will read the same:
[webhook] signature verification failed: No signatures found matching the expected signature for payloadStripe signs every webhook with a secret that belongs to that one endpoint. It starts with whsec_. Your function checks the signature with STRIPE_WEBHOOK_SECRET. If the two values differ, the check fails. The common causes:
- The secret came from
stripe listen, the local testing tool. - Test and live values are mixed up.
- The endpoint was recreated and the environment variable was never updated.
There is one more cause. If the code turns the body into JSON before checking the signature, the check fails even with the right secret. The signature covers the exact raw text, so verify with await req.text() and parse afterwards.
The fix: in Supabase, open Edge Functions, then Secrets, and set the value to the endpoint's signing secret. Redeploy the function. Then open the failed event in Stripe and click Resend.
Case 3: response 200 or 500, but the user is still Free
The function ran and the database did not change. I reproduced this on purpose in a demo project. The function created its Supabase client with the public anon key. Row Level Security (RLS) then blocked the update to the plan column, and it did so without an error. The update simply changed 0 rows. The log line looks like this:
[webhook] profiles update affected 0 rows for user <id> (blocked by RLS or missing row)That line exists because the function counts the rows it changed. Without that check it returns 200 and looks healthy.
// Wrong: the anon key is public, so RLS applies to it
const supabase = createClient(
Deno.env.get("SUPABASE_URL")!,
Deno.env.get("SUPABASE_ANON_KEY")!,
);The fix is to create the client with the service role key inside the function. Newer Supabase projects call the two keys the publishable key and the secret key. The rule is the same: the secret one stays on the server. Keep that key in the function's server environment variables. It must never appear in frontend code. Do not switch RLS off, and do not loosen the policy, just to make this pass.
Also check the row count after the update. If it is 0, return a non-2xx response. Stripe then retries, and the failure stays visible.
Another reason for 0 rows is a missing client_reference_id. When you create the Checkout Session, pass the logged-in user's id as client_reference_id. Otherwise the webhook cannot tell whom to upgrade.
Here is the whole handler, trimmed from the demo project. Your table and column names will differ.
Deno.serve(async (req) => {
const body = await req.text(); // raw text, not req.json()
let event: Stripe.Event;
try {
event = await stripe.webhooks.constructEventAsync(
body,
req.headers.get("Stripe-Signature")!,
Deno.env.get("STRIPE_WEBHOOK_SECRET")!,
undefined,
cryptoProvider,
);
} catch {
return new Response("bad signature", { status: 400 });
}
if (event.type === "checkout.session.completed") {
const session = event.data.object as Stripe.Checkout.Session;
const userId = session.client_reference_id;
if (!userId) return new Response("missing user", { status: 400 });
// Service role key: server environment only, never frontend code
const supabase = createClient(
Deno.env.get("SUPABASE_URL")!,
Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!,
);
const { data, error } = await supabase
.from("profiles")
.update({ plan: "pro", stripe_customer_id: session.customer as string })
.eq("id", userId)
.select("id");
if (error || !data?.length) return new Response("not updated", { status: 500 });
}
return new Response(JSON.stringify({ received: true }));
});Test the fix
- Switch Stripe to test mode. Never test with a real card.
- Pay with the test card
4242 4242 4242 4242, any future expiry date and any CVC. - In the webhook log, confirm the event shows a 200 response.
- In the database, confirm the user's plan changed.
- Refresh the app and confirm the screen changed.
Customers who already paid
After the fix, open the event that failed in Stripe's event list and click Resend. Stripe retries failed deliveries for up to three days in live mode, so recent payments may repair themselves once the function works. Anything older needs a manual resend. Stripe only keeps events available to resend for a limited time, so do this soon. After that you have to edit the database row by hand.
Two related problems
Cancellations and renewals
If you only handle the first payment, cancellations and renewals never reach your database. A cancelled customer keeps the paid plan. Handle customer.subscription.updated and customer.subscription.deleted as well.
Duplicate events
Stripe can deliver the same event more than once. Your handler should be safe to run twice. Store each event id and skip ids you have already processed.
FAQ
Can I just upgrade the user from the success page instead?
No. Anyone can open your success URL, so it proves nothing about payment. Use it to show a message, but let only the webhook change the plan.
Is it safe to turn off RLS to make it work?
No. Anyone with your public key could then read and edit every user's data. Write with the service role key on the server and leave the policies alone.
Do I need to refund the customers who paid and got nothing?
Not necessarily. Fix the cause first, then resend the failed events from Stripe. The upgrade is applied and the customer gets what they paid for.
Checklist
Still stuck?
Send me the app link and what's broken. The first look is free and you get a fixed quote before I touch anything.
Related guides
- Bolt.new Stripe webhook not working after deploying to Netlify (404 or no upgrade)
- Lovable custom domain with Cloudflare: fix "too many redirects" (ERR_TOO_MANY_REDIRECTS)
- Lovable custom domain not working: stuck pending, no SSL, or www fails
- Lovable email verification not working: signup confirmation emails not arriving
- Lovable Google sign in showing redirect_uri_mismatch or an unverified app warning
- Base44 custom domain stuck on Pending verification
- Base44 payment succeeded, but the customer was not upgraded
- Lovable Stripe checkout: "Edge Function returned a non-2xx status code"
- Lovable password reset link not working or sending users to the wrong page
- Replit custom domain not working: stuck on Verifying or showing a blank page
- Is your Supabase data public? A two-minute RLS check
- Blank white page after publishing your AI-built app
- “No such price” when going live: Stripe test and live mode mixed up
- Subscription cancelled in Stripe but the user still has the paid plan
- Stripe webhook signature verification failed (400): causes and fix
- Login sends users to localhost or the preview URL after publishing
- Supabase update returns no error but nothing changes