AI-built apps · November 2026
Short answer: a payment has two halves. First your app sends the customer to Stripe's payment page. Then Stripe tells your app, server to server, that the money arrived (a webhook). AI builders usually get the first half working and leave the second half broken or unsafe, and that half does not show in the builder's preview. Find your symptom below; each one has a fix.
Three places tell you which half is broken:
| What you see | Cause |
|---|---|
| The pay button does nothing, or the payment page stays empty, inside the builder's preview | 1. Stripe's payment page does not open inside a frame |
No such price, Invalid API Key provided, or it works with the test card and fails for real customers | 2. Test and live settings are mixed |
Pressing pay gives blocked by CORS policy, Failed to send a request to the Edge Function, or a 500 | 3. The function that starts the payment fails |
| Stripe shows the payment, the app still says "free"; Stripe's deliveries show nothing, 404 or 401 | 4. Stripe's message never reaches your app |
Deliveries show 400 and No signatures found matching the expected signature for payload | 5. The signature check fails |
| Deliveries show 200, and nothing changes in the database | 6. The function cannot find the user, or cannot write |
| People get the paid plan without paying, a failed payment still saves the order, or cancelled subscribers keep access | 7. The app trusts the browser instead of Stripe |
window.location.href = url) or a new tab. Use Stripe's test card
4242 4242 4242 4242 with any future date and any three digits while you are in test mode.pk_test_ and sk_test_) and live (pk_live_, sk_live_). A
product or price made in one does not exist in the other, so a live key with a test price id answers
No such price. The webhook endpoint and its signing secret are also separate for each.
OPTIONS request), which the console
reports as blocked by CORS policy; the secret key was never saved in the function's secrets; or the
function was written in the builder and never deployed to the Supabase project the live app uses.
OPTIONS with the CORS headers and add the same headers to every other answer, errors included. Save
STRIPE_SECRET_KEY under Edge Functions, Secrets, with exactly the name the code reads. Never put a
key starting sk_ in the app itself: anything in a setting named VITE_… is downloaded by
every visitor.401.
https://<your-project>.supabase.co/functions/v1/<your-function> and choose the events
the code handles (at least checkout.session.completed). Turn off the login requirement for this
one function (verify_jwt = false in supabase/config.toml, or the "Verify JWT" switch in
the function's settings): Stripe's signature is the proof of who is calling, see cause 5. Stripe keeps trying a
failed live delivery for up to three days, and the Resend button works for 15 days, so payments missed while it
was broken can still be delivered after the fix.whsec_…) belongs to a different endpoint or to test
mode; the code reads the message as JSON before checking it, and the check needs the exact original text; or, in
a Supabase function, the code uses the ordinary check, which stops with
SubtleCryptoProvider cannot be used in a synchronous context.
await req.text() and check it with
await stripe.webhooks.constructEventAsync(body, signature, secret) before doing anything else. Never
"fix" a 400 by removing the check: without it, anyone who knows the address can tell your app that they
paid.client_reference_id (or
in metadata), taken from the caller's login on the server, not from a value the browser sends. In
the webhook function, read it back and write with a client made from the service key
(SUPABASE_SERVICE_ROLE_KEY), which exists only in the function's secrets. Check the result of
every write and answer 500 when it fails, so Stripe tries again instead of the payment being lost.customer.subscription.updated, customer.subscription.deleted and
invoice.payment_failed. Stripe can deliver the same message twice and out of order, so save each
event's id and skip one you have already handled.On the published site, in test mode: (1) pay with
4242 4242 4242 4242 and close the tab the moment Stripe says the payment went through, before it
sends you back: your account must still become paid within a minute. (2) Pay with the declined test card
4000 0000 0000 0002: nothing may be saved as paid. (3) Open the thank-you page's address directly in
a new account: nothing may change. (4) Cancel a test subscription in Stripe: the app must take the plan away. If
all four hold, both halves work.
This is a checklist from engineering practice, not a study: we have not counted how often each cause happens. The delivery rules (three days of retries, 15 days of Resend, duplicates, order) and the raw-body rule are from Stripe's webhook documentation; the function settings are from Supabase's own Stripe example. Error messages can differ a little between versions, and Stripe and Supabase rename their menus from time to time. It covers React apps with a Supabase backend and Stripe's hosted payment page, which is what Lovable and Bolt set up by default.
Not sure the data is safe? Six security checks you can run yourself. Nobody can log in on the live site? Login and Supabase errors: seven causes and the fix for each. The app shows nothing at all? A blank page after publishing: six causes. Moving it to your own host? Deploy to Vercel or Netlify: the steps, and six errors that stop it. Slow on phones? Our demo shop, measured before and after: 14.5 s to 1.4 s. Built with Base44? Base44 bug fixing: seven common problems and the fix for each. Replit app bug fixing: seven common problems and the fix for each.
A payment that does not arrive in the app is a bug fix like any other. We fix apps made with Lovable, Bolt, Replit, Cursor and other AI builders, in your own code, and tell you in plain words what was wrong. Fixed prices on Fiverr: one bug from $40, up to five bugs with the app deployed and working live from $150. No fix, no charge. A GitHub invite is enough; we never ask for passwords or for your Stripe keys.
See the gig on Fiverr