You will not build a bank.
Taking money safely, talking to card networks, wallets, and banks, is a specialized, regulated job. You connect to companies that already do it rather than touching raw card details yourself.
Connect to the specialists.
A payment gateway does the charging. You reach it through its API, read its documentation, and it tells you the result, often by calling you back with a webhook when the payment settles.
Never charge twice.
Networks retry and users double-click. Idempotency makes a repeated charge resolve to one. And when two buyers hit the last item at once, a race condition can oversell it, unless you close the gap.
Do the slow work later.
The receipt email shouldn't slow checkout. Background workers pick it up after you respond, a queue keeps that work orderly and safe, and some jobs run on a schedule instead.
One click, many services.
Place an order and your own services start talking: order calls inventory, payment, pricing, and hands notification a task. A feature is a chain of services, and any weak link breaks it.
You worked through Phase 4: take money. 11 new concepts joined your architecture along the way.
Next problem: A viral post sends 5,000 people to your one server at the same moment.