Storing the last 4 digits, the card type, and the cardholder name is fine under PCI. What you must never store is the full PAN, the CVV/CVC, or the magnetic stripe data. Braintree keeps the sensitive fields on its side, so caching just the display fields locally for your UI is compliant. When in doubt, check the PCI Quick Reference Guide, but last-four plus brand plus name is the standard safe set.

Context: Stack Overflow #4495496 (accepted answer, 23 votes): A Rails developer using Braintree wanted to cache a returning customer's last 4 digits, card type, and cardholder name locally to avoid an API call on every page view, and asked whether storing those fields keeps them PCI compliant.