Skip to content

Commit

Permalink
Fixed QR Gen Glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
tuhinpal committed Nov 4, 2020
1 parent 93b66d7 commit 496067b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
*iv. Works with all UPI App.*<br>
*v. Cool and Easy to Use Interface.*<br>
*vi. No Tracking Script & Totally Ads free.*<br>
*vii. Configured for Multi Server Uses (Pay System in Another Server).* <br>

### Best uses:<br>

*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>
*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>

### Deploy: <br>
*Everthing is pre-configured, You can just deploy it on Vercel* <br>
Expand Down
3 changes: 2 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ var QRCode = require("qrcode-svg");

module.exports = (req, res) => {
var url = req.query.url;
var urldecode = url.replace(/~/gi, "&")
res.setHeader("Content-Type", "image/svg+xml");
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate")
res.send(new QRCode(url).svg());
res.send(new QRCode(urldecode).svg());
}
4 changes: 3 additions & 1 deletion js/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ if (virpa == null) {
if (am == null) {
document.getElementById("payingam").innerHTML = "You are paying";
var upilink = "upi://pay?pn=" + vpa + "&tn=UPIER&pa=" + vpa + "&cu=INR";
var qr_string = "upi://pay?pn=" + vpa + "~tn=UPIER~pa=" + vpa + "~cu=INR"
} else {
var amount = params.get('amount');
var upilink = "upi://pay?pn=" + vpa + "&tn=UPIER&pa=" + vpa + "&cu=INR" + "&am=" + amount;
var qr_string = "upi://pay?pn=" + vpa + "~tn=UPIER~pa=" + vpa + "~cu=INR" + "~am=" + amount;
document.getElementById("payingam").innerHTML = "You are paying " + amount + "₹";

}

document.getElementById("vpa").innerHTML = vpa;
document.getElementById("qrcode").src = "../api?url=" + upilink;
document.getElementById("qrcode").src = "../api?url=" + qr_string;
document.getElementById("upibtn").href = upilink;

}
Expand Down

1 comment on commit 496067b

@vercel
Copy link

@vercel vercel bot commented on 496067b Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.