flowchart LR
a[Credit Card] -->|Pay-in| b[Platform's Bank Account] -->|Pay-out| c[Seller's Bank Account]

To accurate bookkeeping.
Record every payment transaction into two separate ledger accounts with the same amount.

Storing credit card info, companies need to deal with complex regulations.
Use hosted credit card pages provided by PSPs. For websites, it is a widget or an iframe, while for mobile applications, it may be a pre-built page from the payment SDK.


Ensure correctness.
Every night the PSP or banks send a settlement file to their clients. The settlement file contains the balance of the bank account, together with all the transactions that took place on this bank account.
May need the finance team to perform manual adjustments.
Situations where a payment request would stall:
Solution:

At-least-once (Retry) + at-most-once.
Use a UUID as an idempotency key (usually the shopping cart ID).
If the payment system has already seen the key, return the latest status.