Stripe: Lumen Home on this reference
How a merchant on Stripe runs Anthropic's Claude Commerce Agents blueprint here, what Stripe test credentials it needs, what was verified against Stripe on 6 September 2026, and which Stripe endpoints the adapter calls.
The demo merchant
Lumen Home is a fictional home retailer: cookware, lighting, office furniture, camping gear, fitness equipment, and toys, 87 products in verticals/lumen_home/data/catalog.json. Its tenders are card, a store card (the Lumen Home Card, 5% back), Apple Pay, Google Pay, Klarna pay in 4, Affirm monthly payments, gift cards, and Pay by Bank, with a loyalty program called Lumen Rewards. Every company, brand, product, and person is fictional; only Stripe is real.
Lumen Home runs on the reference's own storefront and portal web apps (web/storefront, web/portal) on ports 3016 and 3116, with the merchant API on 8016. Its store assistant is the blueprint's shopping agent; its operations assistant is the blueprint's merchant agent, both with the processor layer added underneath.
Checkout in the four models
A merchant on a processor integrates its checkout in one of four ways. The CHECKOUT_MODEL variable picks the model at boot; every demo merchant composes its store with the chosen model's mixin from psp_commerce/integration/ (verticals/lumen_home/api/backend.py for Lumen Home), and Lumen Home is the one whose four pages were each run against Stripe.
| Model | What the checkout button opens | What the Stripe adapter does |
|---|---|---|
hosted (default) |
Stripe Checkout, Stripe's own page | POST /v1/checkout/sessions with ui_mode=hosted_page; the session's url is the button |
server |
The merchant's own page at /store/checkout/{pi_…}, served by the merchant API |
POST /v1/payment_intents, then POST /v1/payment_intents/{id}/confirm from the page's Pay route |
dropin |
The merchant's own page with embedded Checkout inside it | POST /v1/checkout/sessions with ui_mode=embedded_page; the page mounts with the client_secret |
link |
A Stripe Payment Link | POST /v1/prices, then POST /v1/payment_links |
In every model the model behind the assistant sees only a "staged" confirmation. The blueprint's checkout_handoff returns a presentation the storefront renders as a button, and the URL never enters a request to the model.
Getting Stripe test credentials
Everything below was read from Stripe's documentation on 8 September 2026.
- Create an account at https://stripe.com/register. Stripe creates publishable, secret, and restricted keys at signup, and sandbox keys work immediately with no activation (https://docs.stripe.com/keys, https://docs.stripe.com/testing).
- Open Dashboard, Developers, API keys (https://dashboard.stripe.com/test/apikeys). Under Standard keys copy the Secret key, which starts with
sk_test_. Stripe recommends restricted keys (rk_test_) over secret keys; either works for the adapter. - Without an account, the Stripe CLI provisions a sandbox:
stripe sandbox create --email you@example.comprints working keys (secret prefixedrkcs_test_), which expire in seven days unless claimed withstripe sandbox claim(https://docs.stripe.com/cli/sandbox). - For webhooks, open Workbench, Webhooks, "Create an event destination"; the endpoint page shows a signing secret starting
whsec_behind "Reveal secret" (https://docs.stripe.com/webhooks). Locally,stripe listen --forward-to localhost:8016/webhooks/stripeprints one.
Nothing has to be enabled for Checkout, embedded Checkout, or Payment Links; cards and common methods are on by default and managed at Dashboard, Settings, Payment methods.
The variables
Copy .env.example to .env in this folder.
| Variable | Read by | Meaning |
|---|---|---|
STRIPE_SECRET_KEY |
psp_commerce/adapters/stripe.py |
sk_test_…; when set, Lumen Home boots the Stripe adapter |
STRIPE_WEBHOOK_SECRET |
psp_commerce/webhooks.py |
whsec_…, for events forwarded to POST /webhooks/stripe |
STRIPE_PUBLISHABLE_KEY |
the adapter (optional) | pk_test_…, the client key for the drop-in model; the adapter uses a placeholder without it |
ANTHROPIC_API_KEY |
both assistants | the model; without it chat turns fail and everything else works |
CHECKOUT_MODEL |
verticals/lumen_home/api/backend.py |
hosted, server, dropin, or link |
First party and third party
The first-party run starts Lumen Home with its own assistant: first-party/run.sh brings up the API on 8016, the storefront on 3016, and the portal on 3116 (--all is the default; --merchant starts the portal instead of the storefront, --api-only only the API). The walkthrough, from a product question to a Stripe test payment and the assistant reading the order back, is in first-party/README.md.
The third-party run starts only the API and points a platform agent at it: third-party/run.sh runs the scripted agent, --model hands the same tools to Claude or another model, --complete gpay_demo pays with a demo credential on the simulated gateway, and --serve keeps the merchant up for an MCP client such as Claude Code. The endpoints, the handlers Lumen Home advertises, and the exact Claude Code registration are in third-party/README.md.
test.sh
platforms/stripe/test.sh
It runs the pytest subset for this merchant (-k "lumen or stripe or adapters or thirdparty or demo_paths or verticals_boot", 35 of the repository's 69 tests), boots the merchant API and checks the gateway mode matches whether STRIPE_SECRET_KEY is set, fetches the UCP discovery document and a tools/list over MCP, and runs the scripted platform agent to a staged checkout. With the key set it also runs scripts/psp_smoke.py stripe, the live smoke: a hosted session, a payment link, an embedded session, a PaymentIntent confirmed with pm_card_visa, and a transaction list.
== unit and integration tests for the Stripe merchant
PASS pytest (35 passed, 34 deselected in 2.05s)
== the merchant boots
Lumen Home · Stripe · gateway simulated · checkout hosted
PASS simulated gateway (no Stripe credentials set)
== UCP discovery and the MCP handshake
PASS discovery document
PASS tools/list
== a scripted third-party agent shops here
PASS platform agent staged a checkout (continue_url (variant 1, the shopper pays on the processor's page): http://localhost:8016/checkout/cko_…)
ALL PASS (Stripe)
What was verified live
On 6 September 2026, against a Stripe account in test mode: a hosted Checkout Session (ui_mode=hosted_page, API version 2026-03-25.dahlia), an embedded session with a client_secret, a PaymentIntent created, confirmed with pm_card_visa, and captured, a Payment Link, and the reads of PaymentIntents, disputes, and payouts. Lumen Home booted in gateway_mode: live; a first-party chat turn staged a real Checkout Session; the return leg /checkout/return?session_id= answered for an unpaid session (a paid return was not run). Claude Code and the MCP Python client connected to the merchant's UCP endpoint; the platform agent, scripted and Claude-driven, produced a Stripe continue_url; an ACP checkout session returned a Stripe checkout_url with the dev.acp.tokenized.card handler. A placeholder shared payment token drew Stripe's "No such shared_payment_token" error, which confirms the parameter name; a real token needs enrollment in Stripe's program. On 8 September 2026 the whole folder was run again from a fresh copy of the repository with only the READMEs as the guide: test.sh, the first-party conversation through the API, the operations assistant on live figures, every third-party form including Claude Code, and the ACP routes, with Stripe's refusal of a demo credential answered on both protocols. The same day, with CHECKOUT_MODEL=server, a full paid order ran end to end: the assistant staged a PaymentIntent, the merchant's own page authorized it through Stripe's API with pm_card_visa, Stripe reported it succeeded for USD 22.00, and the assistant answered "your payment went through" with the order id.
Troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
ui_mode=hosted_page rejected by Stripe |
The account's default API version predates the Dahlia releases | The adapter pins Stripe-Version: 2026-03-25.dahlia on every request; check the pin in psp_commerce/adapters/stripe.py if you change the version |
| A server-side confirm is refused while redirect methods are enabled | Stripe requires a return_url or no redirect methods |
The adapter sets automatic_payment_methods[allow_redirects]=never on PaymentIntents and passes a return_url on confirm |
gateway_mode: simulated although a key is in .env |
The key was not in the environment of the process that started the API | run.sh exports .env; when starting by hand, export the key in the same shell first |
complete_checkout with a made-up token fails on live Stripe |
Stripe refuses credentials it did not mint | Expected. com.stripe.payments needs a shared payment token from Stripe's program (private preview, waitlist, https://docs.stripe.com/agentic-commerce); com.google.pay needs a real Google Pay payload |
| Webhook events are rejected | The signing secret differs per endpoint and per mode | Copy the whsec_ value for this endpoint from Workbench, or from stripe listen |
Stripe's test card for the hosted page is 4242 4242 4242 4242 with any future expiry and any CVC; 4000 0025 0000 3155 triggers 3-D Secure and 4000 0000 0000 9995 declines (https://docs.stripe.com/testing).
The endpoints the adapter calls
All calls go to https://api.stripe.com/v1, form-encoded, with Authorization: Bearer <secret key>, an Idempotency-Key on writes, and Stripe-Version: 2026-03-25.dahlia. The module docstring of psp_commerce/adapters/stripe.py is the source of this table.
| Gateway method | Stripe call | Run live 6 September 2026 |
|---|---|---|
create_checkout_session |
POST /checkout/sessions (ui_mode=hosted_page, success_url with {CHECKOUT_SESSION_ID}) |
yes |
get_checkout_session |
GET /checkout/sessions/{id} |
yes |
create_payment_intent |
POST /payment_intents |
yes |
authorize_payment |
POST /payment_intents/{id}/confirm, then /capture |
yes |
create_client_session |
POST /checkout/sessions (ui_mode=embedded_page, return_url) |
yes |
create_payment_link |
POST /prices, then POST /payment_links |
yes |
authorize_delegated |
POST /payment_intents with payment_method_data[shared_payment_granted_token] (preview Stripe-Version) or payment_method_data[card][token] for a Google Pay gateway token |
parameter name confirmed by Stripe's error |
transactions, settlement_batches, disputes |
GET /payment_intents, GET /payouts, GET /disputes |
yes |
| webhooks | checkout.session.completed, payment_intent.succeeded, charge.dispute.created, verified from Stripe-Signature |
verifier unit-tested |
The tests in tests/test_adapters_http.py assert the path, the headers, and the body of each of these against a mock transport that answers with Stripe's documented response shapes.