In reality, it takes more than a few seconds to charge a credit card.
Behind the scenes, the process of settling a credit card transaction after committing to it can take days. This is known as clearing.
Accepting a credit card after a few seconds is more like accepting a Bitcoin transaction as soon as you see it on the network (a 0-confirmation transaction), which is what some merchants do.