panku-app/README.md

1# പങ്ക് - panku 2 3A progressive webapp(PWA) for splitting bills between friends. 4 5See it live: https://panku.one0.xyz 6 7All data lives in the browser! 8 9Users add their UPI id and note down activities that they have done 10with their friends. Then can share UPI payment requests as QR codes per activity. Currently sharing is done via WhatsApp messages as a normal 11deep-link i.e an `<a></a>` tag. 12 13At first I thought I could get away with sending a upi link in the message. 14But it turns out, google pay, phonepe and the likes have started marking 15*intents* from links as "insecure" and wont proceed with the payment. 16 17A upi link looks like so 18 19``` 20upi://pay?pa=iamrock@oksbi&pn=James%20Gilbert&cu=INR&am=25.00&tn=Goa%20Trip 21``` 22 23We convert it to a QR code with the lovely [qrcode.react](https://www.npmjs.com/package/qrcode.react) package. 24 25To run the project for the first time 26 27``` 28$ npm i 29$ npm run dev 30``` 31 32## Notes 33 341. URL encoding / decoding funcions 35 36https://meyerweb.com/eric/tools/dencoder/ 37 38``` 39function encode() { 40 var obj = document.getElementById('dencoder'); 41 var unencoded = obj.value; 42 obj.value = encodeURIComponent(unencoded).replace(/'/g,"%27").replace(/"/g,"%22"); 43} 44function decode() { 45 var obj = document.getElementById('dencoder'); 46 var encoded = obj.value; 47 obj.value = decodeURIComponent(encoded.replace(/\+/g, " ")); 48} 49``` 50 51