Skip to content

feat(card): mint the secure card details token (LIVE-34778) - #21467

Draft
philipptpunkt wants to merge 1 commit into
feat/pay-card-devtools-balancefrom
feat/LIVE-34778-card-details-token
Draft

feat(card): mint the secure card details token (LIVE-34778)#21467
philipptpunkt wants to merge 1 commit into
feat/pay-card-devtools-balancefrom
feat/LIVE-34778-card-details-token

Conversation

@philipptpunkt

@philipptpunkt philipptpunkt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Stack (managed by stac-man)

POST /v1/card/details/token answers with a token and an image URL. The image
renders PAN, CVV and expiry, so the card data never passes through the app.

  • A mutation, though it reads. The provider spends the token the first time the
    image is fetched, so a cached answer would be a spent one, and RTK Query
    retains query results while a subscriber lives. Mutations are neither cached
    nor retained, and a test asserts the token never reaches the cache.
  • customCss is optional and validated as hex here, so a bad colour fails
    before the request rather than as a 422.
  • token is a plain non-empty string. The reference calls it a UUID, but the
    card id in the same API is a digit string despite looking like one, and the
    sandbox has already diverged from the reference three times this week.

`POST /v1/card/details/token` answers with a token and an image URL. The image
renders PAN, CVV and expiry, so the card data never passes through the app.

- A mutation, though it reads. The provider spends the token the first time the
  image is fetched, so a cached answer would be a spent one, and RTK Query
  retains query results while a subscriber lives. Mutations are neither cached
  nor retained, and a test asserts the token never reaches the cache.
- `customCss` is optional and validated as hex here, so a bad colour fails
  before the request rather than as a 422.
- `token` is a plain non-empty string. The reference calls it a UUID, but the
  card id in the same API is a digit string despite looking like one, and the
  sandbox has already diverged from the reference three times this week.
Copilot AI lite review requested due to automatic review settings September 2, 2026 18:18
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-1jn6wufu5-ledger-hq-prd.vercel.app

@live-github-bot

live-github-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Mobile Bundle Checks

Comparing ec177cf against d80a0e0.

⚠️ main.ios.jsbundle bundle size significantly increased: 62.5mb -> 62.9mb. Please check if this is expected.
⚠️ main.android.jsbundle bundle size significantly increased: 62.5mb -> 62.9mb. Please check if this is expected.

Desktop Bundle Checks

Comparing ec177cf against d80a0e0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The implementation does not currently validate customCss before sending the request, which contradicts the PR/changeset claims and can lead to invalid payloads still reaching the backend.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new Card Management API endpoint to mint a single-use “card details” token + image URL (so PAN/CVV/expiry can be rendered from an image without the app handling raw card details), along with supporting schemas/types, tests, docs, and a changeset for @domain/api-card-management.

Changes:

  • Introduces createCardDetailsToken RTK Query mutation for POST /v1/card/details/token.
  • Adds Zod schemas + inferred types for the token response and optional customCss payload.
  • Extends test coverage (schema + request behavior) and updates package README + changeset.
File summaries
File Description
domain/api/card-management/src/types.ts Adds inferred types for customCss and the token response.
domain/api/card-management/src/schema.ts Defines Zod schemas for customCss (hex colors) and the token response.
domain/api/card-management/src/schema.test.ts Adds schema tests for token response and customCss validation.
domain/api/card-management/src/api.ts Adds createCardDetailsToken mutation and exports its generated hook.
domain/api/card-management/src/api.test.ts Adds endpoint exposure tests + request tests and a “not in queries cache” assertion.
domain/api/card-management/README.md Documents the new endpoint in the package endpoint table.
.changeset/pay-card-details-token.md Declares a minor bump and documents the new endpoint behavior.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +110 to +114
createCardDetailsToken: build.mutation<PayCardDetailsToken, PayCardDetailsCss | void>({
query: customCss => ({
url: "/v1/card/details/token",
method: "POST",
...(customCss ? { body: { customCss } } : {}),
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
desktop-main 2.5 MB - - -
desktop-preloader 7.1 KB - - -
desktop-renderer 82.4 MB - - -
desktop-webviewDappPreloader 0 B - - -
desktop-webviewPreloader 200.0 B - - -
desktop-workers 36.8 KB - - -
mobile 129.8 MB - - -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.5 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 2.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 82.4 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 30.6 MB - -
🎨 CSS 188.4 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.7 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 0 B - -
🗜️ Gzip Size - - -
📄 JavaScript 0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 200.0 B - -
🗜️ Gzip Size - - -
📄 JavaScript 200.0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.8 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 36.8 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 129.8 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 114.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 15.5 MB - -

Generated by Rsdoctor GitHub Action

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

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