i generally try to pay cash (both in philly and in nyc), but i never ask before I get in. At the end of the trip, if I need to pay with CC and if the driver gives me BS, I just tell him I will not pay for the trip since NYC taxis can't go on duty without operating CC machine. So, if his CC machine really is not working, he shouldn't have gone on duty that day and gotten it fixed. EVERY time I've suggested that, all of a sudden "well, for you i can try to see if it works" and MIRACLE it works!
if it didn't, i wouldn't feel bad walking out. they can't call police on you since they'll get hit for not accepting CC.
but honestly, i really try to use cash and have only had to do this a few times. I do the same when they refuse change from $20 (stated clearly in back of cab that driver has to be able give change from $20)