Customer presents QRC

Introduction

This solution enables customers to make payments using their digital wallets by presenting a QR code for the cashier to scan. When a customer initiates payment through their digital wallet, a unique QR code is generated and displayed on their mobile device. The cashier scans this QR code using the POS system scanner, which processes the payment securely and efficiently. The POS system manages three key functions in this workflow:

  1. QR Code Scanning: The POS system scans the customer's digital wallet-generated QR code to retrieve payment details.
  2. Payment Processing: The POS system communicates with the payment gateway to validate and authorize the transaction.
  3. Transaction Confirmation: The POS receives a response confirming the payment status and provides the customer with a receipt.

🚧

Pre-requisites

Merchant Account Setup: Ensure the merchant has an account with Pockyt.

API Credentials: Obtain merchantNo, storeNo, and verifySign values from Pockyt.


API Diagram

API workflow

📘

API References for Endpoints in this Workflow:

Step-by-Step Description of the QR Code Payment Workflow

Step 1: Generate QR Code

  • Action: The customer’s digital wallet generates a unique QR code when they opt to pay using a digital wallet (e.g., AliPay, WeChat Pay).
  • Process:
    • The digital wallet encodes transaction details into the QR code.
    • The QR code is displayed on the customer's mobile device for scanning.

🚧

The QR code contains encoded payment information, including the customer's wallet ID and transaction details.


Step 2: Scan QR Code

  • Action: The Merchant POS System scans the QR code displayed on the customer's mobile device.
  • Process:
    • A scanner connected to the POS system reads the QR code.
    • The POS extracts encoded payment details, including the wallet ID and transaction amount.

Step 3: Initiate Transaction Request

  • Action: The Merchant POS System sends a payment request to the Payment API.
  • Endpoint: POST app-instore/v3/add
  • Key Parameters:
    • Request Body: Includes transaction amount, merchant ID, and wallet ID.
    • Response: The Payment API acknowledges the request and returns a unique Transaction ID.

Step 4: Process Payment

  • Action: The Payment API communicates with the digital wallet provider to process the payment.
  • Endpoint: `POST app-instore/v3/pay
  • Process:
    • The Payment API sends the transaction details to the digital wallet provider.
    • The digital wallet provider verifies and authorizes the payment.

Step 5: Send Confirmation

  • Action: The Payment API sends the transaction status back to the Merchant POS System.
  • Process:
    • The Payment API returns a success or failure status.
    • The POS system displays the payment result to the cashier and customer.

Step 6: Handle Webhook & Complete Transaction

  • Action: The POS system updates the transaction status and provides a receipt if necessary.
  • Process:
    • If the transaction is successful, the POS system updates its records.
    • The POS system can generate a digital or printed receipt for the customer.
    • The customer receives a notification in their digital wallet confirming the payment.

🧾

A receipt is optional but recommended for customer records.


Key Notes for Implementation

  1. Parameters Flow:

    • transactionNo: Generated in Step 3
  2. Webhook Notifications:

    • Webhook notifications are crucial for confirming the status of transactions in Steps 3 and 6. Ensure the Webhook Listener processes the transactionNo and status fields properly.