Test Stripe Lifetime Billing
Run this test after changing lifetime pricing, Checkout, billing webhooks, the billing portal, onboarding email, password setup, or paid-access behavior.
Give your agent this prompt
Test Stripe lifetime billing in the test environment.
Follow https://coremvp.com/en/docs/billing/stripe/lifetime/test.md. Complete https://coremvp.com/en/docs/billing/stripe/lifetime/configure.md first. Ask me before changing provider settings or secrets; do not use live payments or print secrets.
Remove any conflicting BILLING_DEMO_PROVIDER override from the runner. Finish when ./coremvp e2e billing:lifetime passes and both buyer cases open Stripe test Checkout and show a saved Stripe purchase.
Report what changed, the check result, and anything you could not run.Test locally
Complete lifetime configuration, including the default customer portal, and keep the app and matching Stripe listener running. Add guest email capture to ignored and restart the app:
PAYMENT_PROVIDER=stripe
NEXT_PUBLIC_STRIPE_MODE=test
EMAIL_DELIVERY_MODE=test_capture
TEST_EMAIL_CAPTURE_TOKEN=<private-capture-token>The app and the local runner need the same token. Keep it server and local only: never print it or put it in browser code or URLs. Capture mode supplies the guest's setup link without sending Resend email.
Remove any conflicting BILLING_DEMO_PROVIDER from the runner environment.
It takes precedence over PAYMENT_PROVIDER in the checkout tests.
From your cloned app root, run:
./coremvp e2e billing:lifetimeA passing run exits with code 0 and finishes both buyer cases. The signed-in
case creates its buyer through local signup before payment. The guest case
starts without a session, pays first and completes password setup from its
captured link.
The test checks that:
- the configured lifetime offer opens Stripe-hosted test Checkout;
- both payments return to the app and their signed callbacks store access;
- the fresh guest sets a password and reaches the authenticated app;
- the account readers report the approved lifetime Price and purchase date;
- Billing and its owned Stripe portal reflect the buyer's purchase;
- protected HTML and Markdown allow the buyer, then deny access after signout.
| Symptom | Check |
|---|---|
| The test stops before Checkout | Recheck Stripe test mode, the approved Price mapping and any supplied Product mapping. |
| Payment succeeds but access does not change | Inspect the forwarded checkout.session.completed response. |
| Guest setup cannot retrieve its link | Check that the app and runner share the capture mode and token, then restart the app. Do not substitute another buyer's link. |
Test in production
Production tests still use Stripe test mode; no live charge is made. Target
the exact deployment. First put the deployed app's test Price ID in your
ignored as NEXT_PUBLIC_STRIPE_INDIVIDUAL_PRICE_ID, with the other
values in Prepare the local runner. The test compares the purchase with that value from your shell. The deployed app must use the same Stripe test catalog and webhook destination you are testing. Set up hosted email capture through Production Email, with the same TEST_EMAIL_CAPTURE_TOKEN in the deployed environment and your ignored local .
Load first, then run:
set -a; source .env; set +a
export TEST_BASE_URL=https://<app-domain>
./coremvp prod e2e billing:lifetimeExpect result production E2E passed and your target URL.
One passing ./coremvp prod e2e billing:lifetime run against the Next.js
template on Vercel, shown at 2.5× speed. The guest pays with Stripe's test
card, sets a password, opens the dashboard and then the paid content. The test
account's email and name are hidden.
For the target, required state and coverage, see Deploy and Test Your App.
What the test does not cover
- A live-mode Stripe charge.
- Real Resend inbox delivery. Check it after configuring
EMAIL_DELIVERY_MODE=real. - Production DNS or domain configuration.
- Subscription billing.
What's next
Stripe Guest Checkout and Access
Configure Stripe Webhooks
Was this page helpful?