Skip to content

Add merchant enrichment support for card transactions - #2397

Open
MusabShakeel576 wants to merge 1 commit into
masterfrom
claude/rain-enrichment-card-activities-n9atcz
Open

Add merchant enrichment support for card transactions#2397
MusabShakeel576 wants to merge 1 commit into
masterfrom
claude/rain-enrichment-card-activities-n9atcz

Conversation

@MusabShakeel576

Copy link
Copy Markdown
Contributor

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 getMerchantDisplay utility: Centralizes merchant display logic with a clear fallback chain:

    • Enriched brand name → raw descriptor → transaction description → "Unknown"
    • Enriched category → issuer category
    • Enriched logo URL when available
    • Formatted location with configurable separators and casing
  • New MerchantAvatar component: Displays merchant logos when available, falling back to colored initials avatars. Handles logo load failures gracefully by reverting to initials.

  • Updated CardTransaction type: Added fields for issuer enrichment:

    • merchant_category: issuer's own category
    • enriched_merchant_name, enriched_merchant_category, enriched_merchant_icon: enrichment data
  • Refactored transaction displays: Updated three screens to use the new utilities:

    • Activity transaction list (CardTransactions.tsx)
    • Card details transaction list (card/details/transactions.tsx)
    • Transaction detail screen ([clientTxId].tsx)
  • Comprehensive test coverage: Added 95 lines of tests covering fallback chains, blank value handling, location formatting, and edge cases.

Implementation Details

  • The nonEmpty helper ensures whitespace-only strings are treated as absent, preventing display of raw terminal descriptors like "GOOGLE *Play Books "
  • Merchant enrichment is optional and only arrives after transaction settlement, so initials avatars are not a rare edge case but the normal state for new purchases
  • Logo load failures fall back to initials rather than leaving blank circles, ensuring consistent visual treatment
  • The utility is shared across all transaction displays to ensure consistent merchant naming across the app

https://claude.ai/code/session_01XnuxHDT4YapsUvRzyRqhUR

…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
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored Aug 19, 2026 1:51pm
solid-app-staging Ignored Ignored Aug 19, 2026 1:51pm

Request Review

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