Skip to content

docs: use collectData.schema as source of truth for native UI, deprecate fields - #98

Open
jakubuid wants to merge 2 commits into
mainfrom
docs/collect-data-schema-native-ui
Open

docs: use collectData.schema as source of truth for native UI, deprecate fields#98
jakubuid wants to merge 2 commits into
mainfrom
docs/collect-data-schema-native-ui

Conversation

@jakubuid

@jakubuid jakubuid commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Atom Wallet QA (Slack thread) surfaced that wallets building native data-collection UI render forms from the deprecated collectData.fields array, which only lists name and date of birth — required fields like country never appear. The correct source is collectData.schema (JSON Schema: properties + top-level required + conditional anyOf groups). The docs recommended the WebView flow but never spelled this out for integrators who build native UI anyway.

This PR makes the guidance explicit across all platforms and integration types.

flowchart TD
    A[Option selected with collectData] --> B{UI approach}
    B -- "Recommended" --> C[Display collectData.url in WebView/iframe]
    C --> D[IC_COMPLETE → confirm WITHOUT collectedData]
    B -- "Native UI" --> E[Parse collectData.schema<br/>properties + required + anyOf]
    E --> F[Confirm WITH collectedData built from schema]
    B -. "Never" .-> G[❌ deprecated collectData.fields<br/>incomplete — misses country etc.]
Loading

Changes

  • Shared snippet (snippets/webview-data-collection-overview.mdx, included by all 10 SDK pages — standalone + WalletKit × Kotlin/Swift/Flutter/React Native/Web): new Building Native UI Instead section — parse schema (properties, required, anyOf, validation constraints, tosConfirmed), submit via collectedData, with a <Warning> that fields is deprecated and incomplete
  • All 10 SDK pages: the CollectDataAction data model now labels schema as the native-UI source of truth (url as the recommended WebView flow), with a deprecation warning for fields beneath each model — visible where devs look when their IDE autocompletes the deprecated property
  • API-first guide: expanded native-form guidance (required + anyOf parsing) plus deprecation warning — the raw API response still contains fields
  • Wallets overview FAQ: "Can wallets implement custom UI?" now spells out schema-as-source-of-truth and the fields deprecation
  • AI-prompt pages (×4): model comments updated so generated integrations never use fields
  • PSP Headless SDK (payments/psps/headless-sdk/implementation.mdx): the InformationCapture example rendered a KYC form from collectData.fields — now renders from schema with the deprecation note (headless integrations always build their own UI, so this mattered most)

No API reference changes needed — the OpenAPI specs already mark fields as deprecated: true.

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wc-pay-docs 🟢 Ready View Preview Aug 26, 2026, 7:03 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

…ate fields

Wallets building native data-collection UI were rendering forms from the
deprecated collectData.fields array, which only lists name and date of
birth — missing required fields like country (surfaced in Atom Wallet QA).

- Add "Building Native UI Instead" guidance to the shared WebView snippet
  (all 8 mobile SDK pages) and inline to both web SDK pages: parse
  schema (properties, required, anyOf), never the deprecated fields array
- Remove deprecated fields usage from Flutter, React Native, and Web
  example code
- Mark schema as the native-UI source of truth in every CollectDataAction
  data model, with a deprecation warning for fields
- Clarify confirmPayment examples: collectedData is for native UI only,
  built from schema; omit it when using the WebView/iframe flow
- Expand native-form guidance in the API-first guide and wallets
  overview FAQ
- Update AI-prompt pages so generated integrations never use fields

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Do **not** pass `collectedData` to `confirmPayment()` when using the embedded form. The form handles data submission directly.
</Warning>

### Building Native UI Instead

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Build Native UI instead" appears as a section inside "Embedded Data Collection Form", and also its above "Webview message types", which looks weird in the side bar. Check in the preview link

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in ba578b4. The section was rendering at the end of the shared snippet, so it landed inside "Embedded Data Collection Form" and above "WebView Message Types" on every page. Folded it into an <Accordion> instead: the guidance stays in place but no longer emits a TOC entry, so the sidebar now flows straight from "Customizing the form appearance" to "WebView Message Types".

The "Building Native UI Instead" heading rendered in the on-page TOC
nested under "Embedded Data Collection Form" and above "WebView Message
Types", splitting the embedded-form docs (PR feedback). An accordion
keeps the guidance in place without a TOC entry.

Also say "embedded form" instead of "WebView flow" — the snippet is
shared with the web pages, where the form is an iframe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants