Stripe webhook in Lovable: six payment tests to run with a fresh account
Updated November 23, 2026. 7 min read.
In short. When a customer has paid in Stripe and your Lovable app still shows the free plan, the message Stripe sends to your app (the webhook) never arrived, was rejected, or was attached to the wrong user. Run the six tests below in test mode with a fresh account: each one says what you should see and gives a prompt to paste if you don't. Recheck the setup when you move to live keys, because price IDs and the webhook signing secret both change.
Which Stripe setup does your Lovable app use?
A webhook is a message Stripe sends to your app's server when something happens on its side: a payment, a renewal, a cancellation. Lovable documents two setups, which treat webhooks differently.
- Built-in payments. Lovable creates and manages the Stripe account, the keys and the webhooks. Its payments documentation says test mode applies in the preview and live mode in the published app, each with its own webhook endpoint. Delete your app's endpoint in Stripe, it warns, and purchases still succeed but subscriptions never activate.
- Your own Stripe account. You paste a key into the Connect Stripe form. The Stripe integration page says the key decides the mode (a live key makes preview payments real) and that webhooks are off by default: the app asks Stripe for the payment status directly. If you asked for webhooks, you created the endpoint in Stripe and pasted its signing secret, a value starting with
whsec_that lets your app check the message really comes from Stripe.
What do you need before testing?
Stay in test mode: the preview for built-in payments, a key starting with sk_test_ or rk_test_ for your own account. Open a private window and sign up with an email address the app has never seen: your builder account carries leftover state and proves nothing. For cards, use Stripe's test numbers: 4242 4242 4242 4242 succeeds and 4000 0000 0000 0002 is declined, with any future expiry date and any three-digit CVC.
The six payment tests
1. Pay, and the account unlocks
Subscribe with the success card and come back to the app. You should see: in Stripe, an active subscription under your email; in the app, the paid plan, still there after a reload. If Stripe says active and the app says free, open the Webhooks section of the Stripe dashboard and look at your endpoint's delivery attempts, if your setup has one. A failed delivery points to the endpoint or its secret, a successful one to what your app does with the event.
A test payment succeeded in Stripe (subscription active for [email]) but the account still shows the free plan.
Trace what happens after checkout: which function receives the Stripe event or checks the status, which user it updates, which field the paywall reads.
Show me where the chain breaks before changing any code.
2. Pay, then close the tab
With a second fresh account, pay and close the tab as soon as the payment is confirmed, before returning to the app. Then log in again. You should see: the paid plan. If the unlock only happens on your thank-you page, anyone who loses the connection at that moment pays and stays locked out.
The paid plan must not depend on the customer reaching the success page.
Unlock from a payment status confirmed on the server side (the Stripe webhook, or a status check at login).
3. Declined card
Pay with 4000 0000 0000 0002. You should see: a clear refusal on the payment page, no active subscription in Stripe, an account that stays free. Then pay with the success card on the same account: it must work, with a single active subscription at the end.
With a declined test card, this happened: [what you saw].
Only an active subscription confirmed by Stripe may unlock the paid plan.
Let the customer retry with another card without creating a second subscription.
4. The right account gets the plan
Log in with a fresh account that has not paid. You should see: the free plan. With your own Stripe account, Lovable's documentation says subscriptions are matched to users by email address, which must be the email on the Stripe customer. So try typing a different email on the payment page: if you can, that payment may unlock nobody.
Open checkout with the logged-in user's email prefilled, and store the Stripe customer ID on the user record after the first payment.
Match later payment events through that customer ID, not a typed email.
5. Cancellation
Cancel from the app's "manage subscription" button, outside the preview panel (Lovable notes that Stripe's customer portal does not work there). Stripe's cancellation guide describes two moments. Canceling at period end lets the subscription run until the paid period is over (Stripe sends customer.subscription.updated). Later it really ends (Stripe sends customer.subscription.deleted). You should see: after canceling, access kept and an end date displayed. Then cancel the same subscription immediately from the Stripe dashboard: after a reload, the account is back on the free plan.
When a subscription is set to cancel at period end, keep access and show the end date.
When Stripe reports it as canceled or unpaid, move the account back to the free plan.
6. From test keys to live keys
Stripe's API keys page says objects created in one mode cannot be used in the other, so products and price IDs must exist in live mode. Its webhooks guide says every endpoint has its own signing secret, different in test and in live. And the go-live checklist asks you to confirm a live endpoint is registered. In Lovable with your own account, you submit the live key in the Update Stripe secret key form, then ask Lovable to switch to the live price IDs. You should see: in Stripe's live mode, your products, plus an endpoint pointing at your app if you use webhooks; on the published app, a payment page that opens with the right price.
One caveat: Lovable's page suggests a real purchase on the published app as a final check, while Stripe's testing page says its services agreement prohibits testing in live mode with real payment details. Run every scenario in test mode, keep live checks to configuration, and watch your first genuine order.
We are switching Stripe to live mode. List every place that uses a Stripe key, a price ID or a webhook signing secret, and say whether each one now holds a live value.
Do not print the secret values.
What if Stripe shows failed deliveries?
- In live mode, Stripe retries a failed delivery for up to three days (three times over a few hours in a sandbox). You can also resend an event by hand from the dashboard for up to 15 days after it was created.Source: Stripe documentation, read November 2026
- With Lovable's built-in payments, if every delivery fails with "Invalid webhook signature", ask Lovable to rotate that environment's webhook secret, then publish again right away. Events that failed before the rotation are not sent again.Source: Lovable documentation, read November 2026
If checkout only fails on the published site, start with the gaps between preview and published version. For everything besides payment, see QA for vibe coders.
Frequently asked questions
Why is the subscription active in Stripe but my app is not unlocked?
Stripe took the payment, but your app never recorded it for that user. Either the webhook was not delivered or was rejected (see the delivery attempts in Stripe), or the event was matched to another user, often because of a different email.
Where do I find the Stripe webhook secret for a Lovable app?
With built-in payments, Lovable manages the signing secret and you never handle it. With your own Stripe account, you copy it from the endpoint's page in the Webhooks section of the Stripe dashboard and add it when Lovable asks. Once saved, it cannot be read back.
Why does Stripe work in test mode and fail in live mode?
Test and live are separate worlds in Stripe: keys, products, price IDs and webhook signing secrets all differ. An app that still holds one test value fails as soon as real customers arrive.
Keep reading
- QA for vibe coders: what you can test in one hour without reading the code
- MCP tenant isolation: the second-customer-account test, step by step
- MCP server not showing in Claude: 9 causes, in the order to check them
Want a pair of eyes that has never seen your product?
Cobaye tests your SaaS or your MCP server from the outside, with fresh accounts, and hands you the findings ranked by severity, each with the prompt that fixes it. The first 20 on the waitlist get 50% off their first test.
Join the waitlist