Skip to content

feat(payments): [6/10] add a Payments demo mode behind payments-demo-mode - #2171

Open
arseniy-nikitochkin wants to merge 35 commits into
feat/payments-redesign-4-activityfrom
feat/payments-redesign-5-demo
Open

arseniy-nikitochkin wants to merge 35 commits into
feat/payments-redesign-4-activityfrom
feat/payments-redesign-5-demo

Conversation

@arseniy-nikitochkin

@arseniy-nikitochkin arseniy-nikitochkin commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

5 of 7 in the redesign stack. It adds the Demo switch. Payments then answers from fixtures and replays the session's changes, every ramp provider completes through a stand-in checkout, and BVNK's identity check can be simulated.

  • New flag payments-demo-mode (SDP_FLAG_PAYMENTS_DEMO_MODE, off by default in production). It counts only while new-design is on.
  • Every sdp-web → SDP API call now passes paymentsDemoResponse first (lib/sdp-api.ts). It returns early unless the demo cookie names this project and the page, or the referring page for /api/dashboard/*, is a Payments page on the new design.
  • Demo is judged per page: a Payments page whose design module is off shows neither demo data nor the switch.
  • proxy.ts drops the demo session cookies on a full page load, so demo changes last one page load.
  • The demo only ever serves payment data; project reads pass through, and tests assert nothing else reaches the API.

Verification: tsc clean; biome, copy audit and module boundaries pass; 217 test files (1,868 tests) pass.

image

arseniy-nikitochkin and others added 3 commits September 29, 2026 22:43
…d identity check

Adds the Demo switch: Payments answers from fixtures and replays the session's changes, every
ramp provider completes through a stand-in checkout, amounts are prefilled, and BVNK's identity
check can be simulated. Only on NEW DESIGN.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

# Conflicts:
#	apps/sdp-web/src/components/dashboard-shell.tsx
… flag

Demo mode gets a flag of its own, payments-demo-mode
(SDP_FLAG_PAYMENTS_DEMO_MODE, on by default outside production). It counts
only while NEW DESIGN is on, and demo data is served only to Payments pages
on the new design: a page whose design module is off shows neither demo data
nor the switch. The server judges each request by its page's design module.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sdp-docs Ready Ready Preview Oct 2, 2026 4:38pm UTC
sdp-web Ready Ready Preview Oct 2, 2026 4:38pm UTC

Request Review

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 5225334.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds a demo mode for the payments feature.

The PR appears safe to merge based on the changes reviewed.

Summary

The PR adds a flag-gated Payments demo mode with fixture-backed data, session-scoped simulated actions, and stand-in ramp checkout and verification flows. Changes since the previous review do not overlap this PR’s changes.

Reviews (26) · Last reviewed commit: "Merge branch 'feat/payments-redesign-4-a..."

Comment thread apps/sdp-web/src/lib/payments-demo/demo-replay.ts
Comment thread apps/sdp-web/src/app/dashboard/payments/ramps/hooks/use-onramp-wizard.redesign.ts Outdated
Comment thread apps/sdp-web/src/lib/payments-demo/demo-replay.ts Outdated
Comment thread apps/sdp-web/src/app/dashboard/payments/ramps/hooks/use-onramp-wizard.redesign.ts Outdated
Comment thread apps/sdp-web/src/lib/payments-demo/demo-session.ts Outdated
Comment thread apps/sdp-web/src/i18n/ui-copy-baseline.json Outdated
Comment thread apps/sdp-web/messages/en/dashboard-payments.json Outdated
arseniy-nikitochkin and others added 3 commits October 1, 2026 10:39
The demo switch server action now requires a signed-in organization and
the demo flag before writing cookies. Demo session decoding is bounded
(encoded length and a 64 KiB inflate cap). Ramps never run an asset the
demo wallets lack: the pickers drop those pairs and the demo quotes refuse
them instead of crediting USDC. Simulate deposit is offered only on sandbox
or demo deposits, and the demo simulates Mural in any currency. Demo
payment requests no longer hand out /pay links the public page cannot
open. The demo switch copy no longer claims nothing leaves the browser,
the flag metadata gets reasoned i18n exemptions, the deprecated zod
passthrough is gone, and OfframpStepContent, OfframpRail and
useOnrampWizard shed the complexity this PR added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The demo modules this PR adds pulled sdp-web's global branch coverage to
61.53%, under the 62% gate that failed "Unit Tests (packages)". The
handler tests walk every refusal the SDP API would send, each provider's
quote shape and BVNK's onboarding; the session tests pin the decode
budgets. Trimming an oversized log now cuts in proportion instead of
deflating once per dropped action.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

# Conflicts:
#	apps/sdp-web/src/app/dashboard/payments/ramps/components/offramp-step-content.redesign.tsx
#	apps/sdp-web/src/app/dashboard/payments/ramps/components/onramp-step-content.redesign.tsx
#	apps/sdp-web/src/app/dashboard/payments/requests/payment-request-create-workspace.tsx
#	apps/sdp-web/src/app/dashboard/payments/requests/payment-requests-workspace.redesign.tsx
#	apps/sdp-web/src/i18n/ui-copy-exemptions.json
@greptile-apps

This comment has been minimized.

arseniy-nikitochkin and others added 2 commits October 1, 2026 13:03
…rivations into helpers

The subject key, corridor identity, corridor-scoped record reads, poll key,
current onboarding answer, pending agreements, consent check and block
reason move out of useCounterpartyRequirements into named module functions.
The hook drops below React Doctor's complexity limit; what it returns is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	apps/sdp-web/src/app/dashboard/payments/requests/payment-requests-workspace.redesign.tsx
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	apps/sdp-web/src/app/dashboard/payments/payments-workspace.data.ts
#	apps/sdp-web/src/app/dashboard/payments/ramps/hooks/use-onramp-wizard.redesign.ts
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@arseniy-nikitochkin
arseniy-nikitochkin added this pull request to stack #2185 October 2, 2026 09:02
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@arseniy-nikitochkin arseniy-nikitochkin changed the title feat(payments): [5/9] add a Payments demo mode behind payments-demo-mode feat(payments): [6/10] add a Payments demo mode behind payments-demo-mode Oct 2, 2026
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
arseniy-nikitochkin and others added 2 commits October 2, 2026 15:11
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…edesign-5-demo

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
Preview – sdp-web — 52253340 Deployed Oct 2, 2026 by vercel[bot]
Preview – sdp-docs — 52253340 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant