Presumably you have the original order details stored, so you'll have their name, transaction reference, payment method, etc. For PayPal payments, you can issue a refund directly from your PayPal account - just cross reference the order details you have with those stored in PayPal.
For other card payments, what payment processor do you use? All the main processors have refund functionality built into their APIs. In my experience, the payment processor (who is PCI compliant) stores the card details and provides you with a unique token that identifies that card. You then communicate with them using that token, so any payments or refunds can be processed on the right card.