Skip to main content

Consumer Present Mode (CPM)

Consumer Present Mode (CPM) is used for in-person barcode payments.
The customer presents a dynamic barcode from their wallet app, and the merchant scans it to initiate payment.
This mode is designed exclusively for offline, face-to-face transactions (e.g. retail stores, restaurants, physical POS terminals).
CPM process-flow

When to Use CPM

Use CPM when:
  • The customer is physically present
  • The customer displays a wallet barcode
  • The merchant scans the barcode using a POS device or scanner
  • Immediate payment confirmation is required

API Endpoint

Endpoint : /trade/v1/payment
Method : POST

Supported PayTypes

PayTypeDescription
800008WeChat, Alipay, UNIONPAY Quick Pass CPM
800108Alipay CPM (Overseas & HK Merchants)
800208WeChat CPM (Overseas & HK Merchants)
801008WeChat Pay HK CPM (Direct Settlement, HK Merchants)
805808PayMe CPM (HK Merchants)
800708UNIONPAY Quick Pass CPM
Refer to Signature Generation for request signing instructions.

Request Parameters

FieldRequiredTypeDescription
Common ParametersIncludes mchid, txamt, txdtm, etc.
auth_codeYes (CPM only)String(128)Authorisation code scanned from the customer’s wallet barcode. This value is unique per transaction and must be captured in real-time.

Example Request

HTTP
POST /trade/v1/payment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
X-QF-APPCODE: A6A49A66B4C********94EA95032
X-QF-SIGN: 3b020a6349646684ebeeb0ec2cd3d1fb

auth_code=13485790*******88557&goods_name=qfpay&mchid=R1zQrTdJnn&out_trade_no=Native201907221520536a25477909&pay_type=800208&txamt=10&txcurrcd=HKD&txdtm=2019-07-22 15:20:54&udid=AA

Example Response

JSON
{
  "pay_type": "800108",
  "sysdtm": "2019-07-22 15:20:54",
  "paydtm": "2019-07-22 15:20:56",
  "txdtm": "2019-07-22 15:20:54",
  "udid": "AA",
  "txcurrcd": "EUR",
  "txamt": 10,
  "resperr": "交易成功",
  "respmsg": "OK",
  "out_trade_no": "201907221520536a25477909",
  "syssn": "20190722000300020081074842",
  "respcd": "0000",
  "chnlsn": "4200000384201907223585006133"
}

Response Behaviour

respcd indicates transaction result:
  • 0000 → Payment successful
  • 1143 or 1145 → Transaction is still processing
When 1143 or 1145 is returned:
  • The customer may still be entering their password
  • The wallet provider may still be confirming the payment
  • The transaction is not final
Merchants should call the Transaction Enquiry API to retrieve the final status.

Integration Notes

  • CPM is synchronous but may return a processing state (1143 / 1145).
  • Always treat 1143 / 1145 as pending, not failure.
  • Do not immediately retry a payment if processing is returned.
  • Use Transaction Enquiry to confirm final status.
  • Store the QFPay Transaction ID (syssn) for reconciliation.
  • Implement idempotency using your out_trade_no.

Response Parameters

FieldTypeDescription
syssnStringQFPay Transaction ID (Payment ID for this transaction)
out_trade_noStringMerchant Order Number
respcdStringReturn Code (0000 = success)
sysdtmStringQFPay system processing time
txdtmStringMerchant transaction time
paydtmStringActual payment completion time
chnlsnStringWallet-side transaction reference