How maojidev/promptpay-qr-code-generator works
PromptPay QR Code Generator is a client-side React app: a user enters a PromptPay ID and amount, the app validates the input and generates an EMVCo payload, then displays a QR code and offers payload copying or PNG download. The README also documents quick amount presets and hiding stale QR results after edits; these behaviors live in the main app component. Source excerpts show the entry point, payload generation, clipboard, and download paths; some rendering and validation details are only partially sampled.
Main entry points: App.tsx Generator app · main.tsx React entry · index.css Design system
Components 14
App entry
- React entry
src/main.tsx - Design system
src/index.css
Payment workflow
- Generator app
src/App.tsx - ID and amount form
src/App.tsx - ID validation
src/App.tsx - Amount presets
src/App.tsx - PromptPay payload
src/App.tsx - promptpay-qr
QR and export
- QR display
src/App.tsx - QR canvas renderer
- Slip image export
src/App.tsx - Payload copy
src/App.tsx - Browser APIs
Other components
- User
Connections 14
- User → Generator app: enters payment details
README.md - React entry → Generator app: renders
src/main.tsx - React entry → Design system: imports styles
src/main.tsx - Generator app → ID and amount form: renders form
src/App.tsx - ID and amount form → ID validation: validates ID
src/App.tsx - ID and amount form → Amount presets: offers shortcuts
README.md - Generator app → PromptPay payload: generates payload
src/App.tsx - PromptPay payload → promptpay-qr: calls generator
src/App.tsx - Generator app → QR display: shows generated result
README.md - QR display → QR canvas renderer: renders canvas
README.md - Generator app → Slip image export: builds PNG
src/App.tsx - Slip image export → Browser APIs: downloads image
src/App.tsx - Generator app → Payload copy: copies payload
src/App.tsx - Payload copy → Browser APIs: writes clipboard
src/App.tsx