1. Project Background
During the development of the Cheapcar project, the requirement was to build an automated bank transfer payment system (VietQR) that operates smoothly, delivers instant response times, and optimizes server operating costs. At the same time, the development team needed a secure testing environment (Sandbox) to test the balance and token crediting flow without performing real money transfers.
This led to the development of the SePay integration solution using a Serverless architecture (Cloudflare Workers).
2. Technology Solution
Instead of using a traditional Node.js or PHP server to receive webhooks from banks, this system leverages the power of Cloudflare Workers.
Cloudflare Workers
Acts as an API Gateway and webhook handler operating on the edge network. When a transaction is successfully completed, SePay sends a webhook to the Worker. With an almost zero cold-start time, the system records the transaction and credits tokens to the user in less than one second.
SePay & VietQR
Generates dynamic QR codes containing a predefined transaction amount and an encoded transfer description (for example, PAY20260903BF07CAB1). Users only need to open their banking app and scan the QR code — no manual data entry required — significantly minimizing errors.
3. Key Features
Modern Payment Interface (Optimized UI/UX)
The payment popup clearly displays the payment amount, QR code, and transaction status. Status updates occur in real time, with tokens automatically credited within 10 seconds of a successful transfer.
Smart Dev Sandbox Environment
This is a standout highlight of the system. The interface includes a built-in "DEV – SIMULATE PAYMENT COMPLETED" button, allowing developers or QA engineers to simulate a successful webhook from the bank to the system. This enables full testing of the order processing and balance-crediting flow without incurring any real transaction costs.
Security and Scalability
Webhooks received from SePay are validated using signature validation directly at the Cloudflare network layer, blocking forged requests before they reach Cheapcar's core database. Cloudflare Workers can handle millions of requests per second without the risk of server downtime.
4. Results
Moving the payment flow to Cloudflare Workers not only helped the Cheapcar project operate more smoothly, reducing webhook server maintenance costs by 90% compared to the traditional approach, but also accelerated development through the highly convenient transaction-simulation sandbox tool.
Keywords: SePay integration, VietQR payment system, Cloudflare Workers, serverless payment architecture, webhook signature validation, edge computing payment gateway, Cheapcar, developer sandbox environment, automated bank transfer system
