If you are ever in that situation again, just tell them you only have a credit card, nothing else.
Of course, only do that at the end of the ride.
They are not allowed to pick up passengers if the machine (or meter, or lots of other things) is broken. If it’s genuinely broken and you still want to pay, you can call the number displayed below the machine and pay over the phone.