Bakong KHQR Tutorial

Generate a Cambodian Bakong KHQR code, render it as a scannable image, and poll for payment.

Cambodia's Bakong KHQR is a very different animal from a typical payment gateway integration: generating a KHQR code is an entirely offline operation, with no API call, no merchant account, and no signed request involved. The only network call in this whole flow is checking whether a generated code has actually been paid.

This series walks through the Individual-KHQR flow end to end — generating the code, displaying it as something a banking app can scan, and polling for payment — using the same honesty-over-completeness approach as this site's other tutorial series: what's confirmed against official docs is taught as confirmed, and what genuinely isn't written up yet (Merchant KHQR, going live, callbacks) is named as a gap rather than guessed at.

Source: github.com/Mengsreang-Chhoeung/bakong-khqr-tutorial

  1. 01Getting Started: Concepts and PrerequisitesKHQR generation needs no API call, no gateway account, and no secret key — understand why before writing any code.
  2. 02Generating and Displaying a KHQR CodeGenerate a dynamic Individual KHQR entirely offline, turn the resulting string into a scannable image, and show it on the page.
  3. 03Checking Payment StatusThe one real network call in this whole flow — poll Bakong's Open API with the QR's MD5 hash to find out whether it's actually been paid.
  4. 04What's Not Covered Yet: Merchant KHQR, Going Live, and CallbacksMerchant KHQR, batch status checks, deeplinks, going-live, and callbacks — an honest list of what this series doesn't cover, and why.