It's stored by your bank but your credit card or account id is never transferred to the retailer by the payment processors instead what happens is that McDonalds get an unique transaction ID that only your card provider knows was generated by your card.