Contact me →

← All projects

KHQR Payment Integration

KHQR Payment Integration preview

I built this project to learn how KHQR payment integration works with the Bakong Open API. It combines a reusable server-side JavaScript module with a responsive checkout interface and SQLite payment records. The module can be reused in Node.js and Next.js projects, with demo and live modes and API credentials kept on the server.

Features

  • Generates dynamic KHQR codes with payment amounts and expiry times.
  • Verifies the receiving account, amount, and currency server-side.
  • Automatically checks payment status every 15 seconds.
  • Stores payment records in SQLite and prevents duplicate transaction reuse.
  • Supports separate demo and live modes while keeping API credentials on the server.
  • Provides a reusable module for Node.js and Next.js projects.

Results

Successfully tested live payments and passed 8 automated tests covering payment verification, expiry, access control, duplicate protection, and concurrent checks.