I'm having a problem understanding this concept. I'm using a payment gateway, and I'm not storing the credit card details anywhere. I get the payment information by using hosted payment fields. I want to add a place on the user's profile where they can view their card type, and expiration date.
I'm not storing this data, so the only way I'd be able to get the credit card details would be calling the payment gateway. As far as I know sending credit card details from client to server normally goes against PCI compliance standards. In that case I don't really understand the concept of calling the payment gateway api to get the card data from the client side. How do I go about getting the card data on file, and then allowing the users to view it in a location that isn't within a transaction space?
PCI DSS 3.2.1 says this about credit card data on page 7:
It's widely accepted that expiration dates on their own are acceptable and will not impact your eligibility to certify your PCI compliance using SAQ-A - the easiest and most favorable way to certify PCI compliance.
I imagine most payment gateways will allow you to access the expiration dates for cards after tokenizing the data - which I suspect you're already doing. Stripe seems to return this data with their tokens:
The specifics will vary depending on your payment gateway.