Add merchant enrichment support for card transactions - #2397
Open
MusabShakeel576 wants to merge 1 commit into
Open
Add merchant enrichment support for card transactions#2397MusabShakeel576 wants to merge 1 commit into
MusabShakeel576 wants to merge 1 commit into
Conversation
…tivities The issuer now returns merchant enrichment alongside the raw acquirer descriptor: a clean brand name, a category, and a hosted logo URL. Show them where a card transaction names its merchant. - getMerchantDisplay resolves one merchant view for every card surface: brand name -> raw descriptor -> description -> "Unknown", plus logo, category and location. The activity list, the card transaction list and the transaction detail screen all read through it, so they can no longer drift apart. - MerchantAvatar renders the merchant logo, falling back to the existing initials avatar when there is no logo or the image fails to load. The detail screen passes its own grey-circle fallback so its look is unchanged. - the detail screen's Category row prefers the issuer's category over our MCC lookup table, which only names the bucket the acquirer filed the merchant under Enrichment is optional and never arrives before settlement, so the fallbacks are the normal path for a fresh purchase, not an edge case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XnuxHDT4YapsUvRzyRqhUR
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for displaying enriched merchant data (brand names, logos, and categories) from card issuers, with proper fallback handling for transactions before settlement when enrichment is unavailable.
Key Changes
New
getMerchantDisplayutility: Centralizes merchant display logic with a clear fallback chain:New
MerchantAvatarcomponent: Displays merchant logos when available, falling back to colored initials avatars. Handles logo load failures gracefully by reverting to initials.Updated
CardTransactiontype: Added fields for issuer enrichment:merchant_category: issuer's own categoryenriched_merchant_name,enriched_merchant_category,enriched_merchant_icon: enrichment dataRefactored transaction displays: Updated three screens to use the new utilities:
CardTransactions.tsx)card/details/transactions.tsx)[clientTxId].tsx)Comprehensive test coverage: Added 95 lines of tests covering fallback chains, blank value handling, location formatting, and edge cases.
Implementation Details
nonEmptyhelper ensures whitespace-only strings are treated as absent, preventing display of raw terminal descriptors like "GOOGLE *Play Books "https://claude.ai/code/session_01XnuxHDT4YapsUvRzyRqhUR