feat(card): cp-7.68.0 Add View PIN option#26646
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are well-isolated to the Card feature and don't affect:
The SmokeCard tag is appropriate as it tests "Card home screen display", "Advanced Card Management", and card-related analytics events. The existing E2E test While the SmokeCard tag description mentions selecting SmokeTrade and SmokeConfirmations, that guidance is specifically for "Add Funds uses swaps which require transaction confirmations" - this PR doesn't touch Add Funds functionality, only adds View PIN which doesn't involve swaps or confirmations. Performance Test Selection: |
Description
Adds a "View PIN" option to the Card Home manage card section, allowing users to securely view their card PIN through a PCI-compliant image-based display.
Why: Users need to retrieve their card PIN (e.g. for ATM use or in-store transactions). The PIN is never transmitted as plain text — it is rendered as an image via a time-limited, single-use secure token from the
POST /v1/card/pin/tokenendpoint, ensuring PCI compliance.What changed:
CardSDK.generateCardPinToken): CallsPOST /v1/card/pin/tokenwith optionalcustomCssfor theming the PIN image. Mirrors the existinggenerateCardDetailsTokenpattern with proper error handling.cardQueries.pinkey factory andpinTokenMutationFnfollowing the established React Query patterns from the codebase.useCardPinTokenhook: WrapsuseMutationfor PIN token generation. Automatically applies dark/light theme-awarecustomCss(background and text colors) so the PIN image matches the app appearance.ViewPinBottomSheetcomponent: Displays the PIN image in a bottom sheet with a skeleton loader andCardScreenshotDeterrentenabled to prevent screenshots of sensitive data.CardHomeintegration: NewManageCardListItemfor "View PIN" with biometric authentication gating (matching the "View Card Details" flow). Falls back to password bottom sheet with a PIN-specific description when biometrics are not configured. Visible for US users (all card types) and international users with non-virtual cards.VIEW_PIN_BUTTONaction toCardActionsenum, tracked viaCARD_BUTTON_CLICKEDevent.CardViewPinModalroute and added theViewPinBottomSheetscreen toCardModalsRoutes.Changelog
CHANGELOG entry: Added "View PIN" option to the Card Home screen, allowing users to securely view their card PIN via biometric or password authentication.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds a new authenticated flow to fetch and display a sensitive card PIN image via a new SDK endpoint and modal UI, with biometric/password gating and error handling. Risk is mainly around auth/error-state handling and the new network call/token lifecycle.
Overview
Adds a new “View PIN” manage-card action on
CardHome, shown only for eligible users (authenticated, has a card, not loading; US users or non-virtual cards), gated byreauthenticate()with a password-bottom-sheet fallback when biometrics aren’t configured and guarded against concurrent loads.Introduces PIN-token generation plumbing:
CardSDK.generateCardPinTokencallingPOST /v1/card/pin/token, React QuerycardQueries.pin+useCardPinToken(theme-awarecustomCss), plus a newViewPinBottomSheetmodal route (Routes.CARD.MODALS.VIEW_PIN) that renders the PIN image with a skeleton loader andCardScreenshotDeterrentenabled.Updates analytics (
CardActions.VIEW_PIN_BUTTON), test IDs, and English strings, and adds comprehensive tests for the SDK/query/hook, the new bottom sheet (snapshot/render), and CardHome visibility/auth/error flows.Written by Cursor Bugbot for commit 514ae0c. This will update automatically on new commits. Configure here.