Customs would argue you can't use a credit card anonymously.
In the US at least, anonymity has nothing to do with it. CBP only cares about value.
It's not only cash, if the value is for instance in gold you'll still need to declare it.
Duh.
Same applies to any goods, food, other items of value though they of course may be subject to other specific restrictions or import duties based on value.