This commit is contained in:
Viet An
2026-06-23 14:06:29 +07:00
parent e9fcfbe610
commit 059f232283
10 changed files with 441 additions and 118 deletions

20
app/utils/qr.js Normal file
View File

@@ -0,0 +1,20 @@
export default function qr(amount, qrVars = {}) {
const defaultQRVars = {
bankId: "BIDV",
accountNo: "1222198820",
accountName: "Nguyen Viet An",
template: "Rxp4lcv",
description: "Thanh toan ERP",
};
const finalVars = {
...defaultQRVars,
...qrVars,
};
const { bankId, accountNo, template, description, accountName } = finalVars;
const qrSrc = `https://img.vietqr.io/image/${bankId}-${accountNo}-${template}.png?amount=${amount}&addInfo=${description}&accountName=${accountName}`;
return qrSrc;
}