I would say they didn’t answer the question as given.
I think you’re all giving person 2 too much credit(heh). Generally when a cashier asks cash or credit, that is all the information they need. If doesn’t matter if it’s Visa/Mastercard/Amex/ Discover or anything else, the register can process them all from the ‘credit’ selection.
Normal conversations usually flow along in a manner that’s not like a strictly logical argument. There are various ways of formulating the implicit assumptions that people make. One such way is the Gricean maxims. One of the maxims is the assumption of relevance. Since the answer to that question was neither of the choices given, Person 1 will assume that Person 2’s answer is somehow relevant to the choice between credit and cash. Since Visa is a credit card, Person 1 will assume that Person 2 means that they are using a credit card and, furthermore, the card will be Visa.
I noticed an example today where this pattern was actually expected. Someone asked me if I knew what time it was. I imagine he would have been quite confused if I had answered “yes”. In fact, he probably already knew that, from seeing the watch on my wrist. Instead, I anticipated the next question, and said “two thirty”.