Rovenue SDKBeta
FunnelsWeb

Checkout

How a web funnel sells — the checkout action on its own screen, the Stripe gate on publish, and what the runner and the server do when the visitor pays.

A web funnel sells on the page, through your connected Stripe account. A native funnel sells through the app store instead: checkout is a web-only action (packages/shared/src/funnel/checkout.ts:22-23), and the publish route demands a Stripe account that can take a card only of a web funnel with a checkout (apps/api/src/routes/dashboard/funnels.ts:678-686).

The button and the list

A sale needs two things on the same screen: a packageList naming the funnel's offering, and a button whose action is checkout. The checkout buys what a list on its own screen selects — a checkout with no package list on its page is the CHECKOUT_WITHOUT_PACKAGE_LIST blocker (packages/shared/src/funnel/checkout.ts:147-149, packages/shared/src/funnel/checkout.ts:168-175). A funnel sells one offering: the lists must name exactly one between them (packages/shared/src/funnel/checkout.ts:129-132).

A paywall screen alone does not count — it shows an offer and has never had a purchase path (packages/shared/src/funnel/checkout.ts:138-140). The full set of selling blockers, with the codes publish refuses with, lives on Publishing.

The checkout action waits on the payment, so nothing may follow it. See the checkout row in Routing.

The inline wallet step

A checkout action opens the payment on its own screen. The expressCheckout block instead mounts the wallet buttons — Apple Pay / Google Pay — inline, on the selling page itself (packages/shared/src/funnel/blocks-schema.ts:286). Like a checkout, it buys what the page's packageList selected, through the same endpoint, so the same rule applies: a block with no list on its own page is the EXPRESS_WITHOUT_PACKAGE_LIST blocker (packages/shared/src/funnel/checkout.ts:53). And like a checkout, it sells on its own: a web funnel with an express block but no checkout action still publishes (packages/shared/src/funnel/checkout.ts:135).

The block carries its own fallback: when no wallet can run here, the runner draws the block's children instead (packages/funnel-renderer/src/blocks/express.tsx:49) — usually a button whose action is checkout, so the page sells either way. Two things decide which half shows. The wallet needs an email, and the intent endpoint refuses to create without one, so until an earlier page has collected an address the fallback draws; and Stripe itself reports whether a wallet exists on the device, so a desktop browser with none also gets the fallback. The intent is one per page, shared by every express block on it (apps/dashboard/src/runner/express-host.tsx:106).

In the builder, the canvas draws the block as the wallet's own logo button above its fallback — Apple Pay in an iOS frame, G Pay in an Android one — editor-only mocks; the buyer still gets Stripe's buttons (packages/funnel-renderer/src/blocks/express.tsx:153). And whenever the selected page (or block) sells, the right panel opens with a Payments section: green while the project's Stripe connection is live, a red "No Stripe connection" error with a Connect button for the owner when it is missing (apps/dashboard/src/components/funnel-builder/payments-section.tsx:84).

Live and test side by side

A project can hold two Stripe connections at once: one Live and one Test, each connected and disconnected on its own row of the Stripe card under Stores. Both may point at the same Stripe account.

  • Published funnels sell through Live. A visitor on a published funnel pays through the live connection. Only when the project has no live connection does it fall back to Test, and the Stripe card then warns that published funnels are charging in test mode, so connect Live before launch.
  • A session keeps its mode. The mode is fixed when the session starts; every later charge, upsell and refund for it uses that mode's connection. Disconnecting a mode never moves its sessions to the other one.
  • Products carry a test price. Each product's Stripe section has a Live price ID and a Test price ID (and an intro pair where the product has an intro price). Live checkout sells only the live ids; test checkout sells only the test ids, so a product without a test price ID cannot be bought in test mode and the form says so. Catalog import from a test catalog fills the test field.

Test checkout

To try a purchase without real money, publish the funnel, connect Test, and press Test checkout in the funnel builder's header. It opens the published version of the funnel in a new tab with a signed ?sandbox= token: the session runs in test mode, charges the test connection with the test price IDs (Stripe's test cards work), and the page shows a "Test mode — no real charges" bar. The link is valid for 24 hours and for that funnel only; an expired or foreign token is refused rather than quietly opening a live session, and the refusal page links to the live funnel. A plain link without the token is always the live funnel, so visitors can never reach test mode on their own.

A test purchase is recorded as SANDBOX (see Production & Sandbox). Whether it unlocks entitlements follows the project's Sandbox testing access setting under project settings, the same as Apple and Google sandbox purchases.

How the runner takes the payment

The visitor never leaves the page. The runner posts to POST /funnel-sessions/:sessionId/payment-intent with the picked package, the page the buyer is on, and an email (apps/api/src/routes/public/funnel-payment.ts:65-69, apps/api/src/routes/public/funnel-payment.ts:742-755):

{
  "package_identifier": "pro_monthly",
  "page_id": "paywall-1",
  "email": "buyer@example.com"
}

The server charges only a session that is still in_progress (apps/api/src/routes/public/funnel-payment.ts:757-761). When the project cannot take a card it answers 409 STRIPE_NOT_CONNECTED (apps/api/src/routes/public/funnel-payment.ts:763-768) — the same code that gates publish. The named package must be the one the session's machine recorded as selected, never merely the one the request names (apps/api/src/routes/public/funnel-payment.ts:770-775); the offering is resolved through the checkout page the buyer is actually on (apps/api/src/routes/public/funnel-payment.ts:121-136), and any amount in the request is ignored — the price comes from the Stripe Price on the connected account (apps/api/src/routes/public/funnel-payment.ts:39-44).

The intent endpoint answers with a client_secret, the matching publishable_key, and the stripe_account (apps/api/src/routes/public/funnel-payment.ts:1185-1190). The runner confirms through that connected account — card form and Express Checkout (Apple Pay / Google Pay) share one code path, with redirect: "if_required" keeping the buyer on the page (apps/dashboard/src/runner/payment-step.tsx:7-16). After Stripe says the money moved, the runner still has to ask the server to settle: it posts to POST /funnel-sessions/:sessionId/confirm, which asks Stripe — never the browser — whether the payment settled, retrying the transient answer with backoff (apps/api/src/routes/public/funnel-payment.ts:1303-1341, apps/dashboard/src/runner/payment-step.tsx:156-180).

Free trials: once per buyer

A package whose Stripe Price carries a trial (recurring.trial_period_days) starts the trial at most once per buyer, per mode (test and live count separately): once per email within the project, and once per card within the connected Stripe account, so projects sharing one account share card history. Two signals identify a buyer, because a funnel visitor is anonymous and every attempt gets a new Stripe Customer:

  • Email. The address is normalized first: case and surrounding spaces are ignored, a +tag is dropped, and for Gmail the dots are dropped and googlemail.com counts as gmail.com. Only a keyed hash is stored.
  • Card. The card's Stripe fingerprint, once the visitor confirms it.

A visitor who changes package or reopens the checkout in the same session keeps the trial: the claim moves to the new attempt.

IP addresses and devices are never used: shared networks and family devices would refuse the wrong people.

What the buyer sees:

  1. At payment-intent. A buyer whose normalized email already used the trial gets a subscription without it. The response says so before anything is charged: trial_applied: false, mode: "payment", and amount_due_now (minor units) with currency. The runner shows the real charge-today amount instead of the trial copy. Picking a package claims nothing, so a visitor who never enters a card keeps the trial.
  2. At card confirmation. The trial is claimed when the card is confirmed, on setup_intent.succeeded — so it holds when the visitor closes the tab before /confirm. A card already used for a trial under another email refuses it: the trial subscription is canceled at once, without proration and without a charge, and it grants no access. /confirm then answers 409 TRIAL_ALREADY_USED, with the full price in details (amountCents, currency). A refused trial never reaches integrations: no lifecycle event, revenue or cancellation is recorded for it. If Stripe cannot be reached to cancel it, every later event for the subscription and an hourly reconcile job retry the cancel.
  3. Continue at full price. The runner shows one button. It calls payment-intent again with "no_trial": true, which creates a no-trial subscription on the card the buyer already confirmed; the browser confirms its first payment (3D Secure may be needed). If Stripe's amount due differs from the one on the button, the button shows the new amount and waits for a second click. Nothing is charged without the click. The inline wallet shows the charge-today amount next to Apple Pay / Google Pay when no trial applies, and a wallet trial refused at confirmation opens this same full-price step.

Limits:

  • Apple Pay and Google Pay pay with device tokens, whose fingerprint can differ from the same card typed in; payment methods that are not cards have no fingerprint. Those buyers are limited by their email only.
  • The paywall page draws the Price's trial before the buyer gives an email; the checkout step corrects it before any charge.
  • A refund or a canceled subscription does not give the trial back. Erasing the subscriber (GDPR) deletes their trial records.
  • Trials started by the web SDK's checkout() follow their own rule (once per identified app user, see the web platform guide) and are not counted here.
  • Trials started before this rule shipped are not recorded, and a trial the account owner ends early (before the card is confirmed) completes without a record. During a rolling deploy, an older API instance may complete a trial without recording it. Each of these can let one buyer trial twice.
  • Email records are keyed with a secret derived from the deployment's ENCRYPTION_KEY: rotating that key resets them.

Saving the card for upsells

A funnel with a one-click upsell charges the card from the first payment again, so the first payment has to save it. It does so only when the session's pinned version carries an offer and the browser reports that it showed the consent line, with the current wording version, under the pay button (apps/api/src/routes/public/funnel-payment.ts:1392-1400). On a funnel without an offer, nothing here changes: no consent line, no extra field, the same Stripe calls.

The runner sends the consent with the intent request:

{
  "package_identifier": "pro_monthly",
  "page_id": "paywall-1",
  "email": "buyer@example.com",
  "consent": { "shown": true, "text_version": "2026-11-09.1" }
}

(packages/shared/src/funnel/upsell.ts:410-415). A missing or malformed consent is no consent, never a refused payment (apps/api/src/routes/public/funnel-payment.ts:193-198). With a valid one, each path saves the card like this:

First paymentHow the card is saved
One-time pricesetup_future_usage: "off_session" on the PaymentIntent, added only with the consent (apps/api/src/routes/public/funnel-payment.ts:1698-1702). off_session, because an accepted add-on subscription renews without the buyer
Subscription charged nowUnchanged: the subscription already saves the card with save_default_payment_method: "on_subscription" (apps/api/src/routes/public/funnel-payment.ts:1608)
Subscription with a free trialUnchanged: the trial's setup intent saves it
Apple Pay / Google PayAs the path above it. The offers then use the wallet sheet instead of charging silently

The purchase stores the consent wording's version and the time it was shown, as the record that the buyer agreed to have the card stored. When the payment settles, it also stores which method paid, its fingerprint (keyed hash), the wallet if any, and the Stripe account and mode (apps/api/src/services/funnel/complete-purchase.ts:209-230). Only a card (including Apple Pay and Google Pay, which pay through a card) or a Link payment method can be charged again; checkout offers no other methods (see Payment methods).

The consent line's wording, and where it shows, is on One-click Upsells.

What a paid session emits

Settling runs one shared service, whether the browser's /confirm or the Connect webhook (for the buyer who closed the tab) gets there first (apps/api/src/routes/public/funnel-payment.ts:1246-1255). It marks the purchase paid, moves the session to paid, mints the claim token, and — inside the same transaction — emits funnel.session.paid and funnel.claim_token.issued (apps/api/src/services/funnel/complete-purchase.ts:391-397, apps/api/src/services/funnel/complete-purchase.ts:460-473). The paid session events are part of the public webhook set (packages/shared/src/integrations.ts:21-27).

The plaintext claim token is what carries the purchase into the app. How it gets there is Claiming the Result.

On this page