The bigger issue is that they wanted to search an opaque bag. For no reason other than they were curious. Then when it's opened, and shows cards, again, they wanted to search, for no reason other than curiosity.
No, they asked what was in the bag and the driver said it was gift cards (bought in suspicious circumstances) and then handed it to the cop. He both incriminated himself and consented to the search. Textbook "don't talk to cops" stuff.