Developers have this infamous interview question "what happens when you type google.com into your browser's address box and press enter?"
Let's answer a set of similar questions, but in the money space :$
- The point of sale (PoS) prompts for your PIN, or read information in your magnetic stripe or via RFID (touchless payment)
- It then needs to ask for an authorization to your bank (issuing bank, as they "issued" the credit or debit card).
- The PoS uses the internet to talk to its acquiring bank (the one that acquired the business, asking them if they wanted to support bank cards and providing the PoS).
- The acquiring bank talks to the VISA/Mastercard network.
- The VISA/Mastercard network do a bunch of fraud check, then talk to the issuing bank (your bank).
- The issuing bank approves the transfer (after checking for fraud as well).
- The VISA/Mastercard network forwards the authorization back to the acquiring bank, who forward it to the PoS.
- The transaction is done from your point of view.
- Later during the day, the merchant files all of the receipts into a system
- The acquiring bank sends all of these transactions to the Visa/Mastercard network
- Settlement then needs to happen: the issuing bank needs to pay the acquiring bank.
- It is not clear what happens here, but it seems like if the two banks (issuing and acquiring) are in the same country, then the country's national settlement system can be used (usually provided by a central bank)
- If the country does not have a national settlement system, they can use SWIFT and find a route of pairs of banks (think dominos) that correspond with one another (a pair of bank A and B are correspondent banks if bank A has an account at bank B, and bank B has an account at bank A).
- If the transaction is cross-country, either SWIFT can be used (where at some points two correspond banks operate in different countries), or the central bank of central banks (BIS)
- Eventually, each bank on the path needs to update their databases to reflect the movement of money.