Files
system-design-101/data/guides/how-does-scan-to-pay-work.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

1.9 KiB
Raw Permalink Blame History

title, description, image, createdAt, draft, categories, tags
title description image createdAt draft categories tags
How Scan to Pay Works Explore the mechanics behind scan-to-pay systems and digital wallets. https://assets.bytebytego.com/diagrams/0323-scan-to-pay.png 2024-03-05 false
payment-and-fintech
Payment Systems
QR Codes

How do you pay from your digital wallet, such as Paypal, Paytm and Venmo, by scanning the QR code?

To understand the process involved, we need to divide the “scan to pay” process into two sub-processes:

  1. Merchant generates a QR code and displays it on the screen
  2. Consumer scans the QR code and pays

Here are the steps for generating the QR code:

  1. When you want to pay for your shopping, the cashier tallies up all the goods and calculates the total amount due, for example, $123.45. The checkout has an order ID of SN129803. The cashier clicks the “checkout” button.
  2. The cashiers computer sends the order ID and the amount to PSP.
  3. The PSP saves this information to the database and generates a QR code URL.
  4. PSPs Payment Gateway service reads the QR code URL.
  5. The payment gateway returns the QR code URL to the merchants computer.
  6. The merchants computer sends the QR code URL (or image) to the checkout counter.
  7. The checkout counter displays the QR code.

These 7 steps complete in less than a second. Now its the consumers turn to pay from their digital wallet by scanning the QR code:

  1. The consumer opens their digital wallet app to scan the QR code.
  2. After confirming the amount is correct, the client clicks the “pay” button.
  3. The digital wallet App notifies the PSP that the consumer has paid the given QR code.
  4. The PSP payment gateway marks this QR code as paid and returns a success message to the consumers digital wallet App.
  5. The PSP payment gateway notifies the merchant that the consumer has paid the given QR code.