# Scan to pay
To understand the process involved, we need to divide the “scan to pay” process into two sub-processes:
- Merchant generates a QR code and displays it on the screen (1 - 7)
- Consumer scans the QR code and pays (8 - 12)
# Generating the QR code:
- 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 ofSN129803
. The cashier clicks the “checkout” button. - The cashier’s computer sends the order ID and the amount to PSP.
- The PSP saves this information to the database and generates a QR code URL.
- PSP’s Payment Gateway service reads the QR code URL.
- The payment gateway returns the QR code URL to the merchant’s computer.
- The merchant’s computer sends the QR code URL (or image) to the checkout counter.
- The checkout counter displays the QR code.
# Consumer scans the QR code
- The consumer opens their digital wallet app to scan the QR code.
- After confirming the amount is correct, the client clicks the “pay” button.
- The digital wallet App notifies the PSP that the consumer has paid the given QR code.
- The PSP payment gateway marks this QR code as paid and returns a success message to the consumer’s digital wallet App.
- The PSP payment gateway notifies the merchant that the consumer has paid the given QR code.