Skip to content

Commit 496067b

Browse files
committed
Fixed QR Gen Glitch
1 parent 93b66d7 commit 496067b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
*iv. Works with all UPI App.*<br>
1818
*v. Cool and Easy to Use Interface.*<br>
1919
*vi. No Tracking Script & Totally Ads free.*<br>
20-
*vii. Configured for Multi Server Uses (Pay System in Another Server).* <br>
2120

2221
### Best uses:<br>
2322

24-
*This will help Local Businesses to recieve their Payment via UPI Link. Because this is [MIT Licenced ](https://github.com/cachecleanerjeet/Upier/blob/master/LICENSE "MIT Licenced ")you can customize it however you need & impliment on your Business .*<br><br>
23+
*This will help Local Businesses to recieve their Payment via UPI Link. Because this is [MIT Licenced ](https://github.com/cachecleanerjeet/Upier/blob/master/LICENSE "MIT Licenced ")you can customize it however you need & impliment on your Business.*<br><br>
2524

2625
### Deploy: <br>
2726
*Everthing is pre-configured, You can just deploy it on Vercel* <br>

api/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ var QRCode = require("qrcode-svg");
22

33
module.exports = (req, res) => {
44
var url = req.query.url;
5+
var urldecode = url.replace(/~/gi, "&")
56
res.setHeader("Content-Type", "image/svg+xml");
67
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate")
7-
res.send(new QRCode(url).svg());
8+
res.send(new QRCode(urldecode).svg());
89
}

js/pay.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ if (virpa == null) {
1414
if (am == null) {
1515
document.getElementById("payingam").innerHTML = "You are paying";
1616
var upilink = "upi://pay?pn=" + vpa + "&tn=UPIER&pa=" + vpa + "&cu=INR";
17+
var qr_string = "upi://pay?pn=" + vpa + "~tn=UPIER~pa=" + vpa + "~cu=INR"
1718
} else {
1819
var amount = params.get('amount');
1920
var upilink = "upi://pay?pn=" + vpa + "&tn=UPIER&pa=" + vpa + "&cu=INR" + "&am=" + amount;
21+
var qr_string = "upi://pay?pn=" + vpa + "~tn=UPIER~pa=" + vpa + "~cu=INR" + "~am=" + amount;
2022
document.getElementById("payingam").innerHTML = "You are paying " + amount + "₹";
2123

2224
}
2325

2426
document.getElementById("vpa").innerHTML = vpa;
25-
document.getElementById("qrcode").src = "../api?url=" + upilink;
27+
document.getElementById("qrcode").src = "../api?url=" + qr_string;
2628
document.getElementById("upibtn").href = upilink;
2729

2830
}

0 commit comments

Comments
 (0)