top of page

QR Code

Writer: Vidhi AggarwalVidhi Aggarwal

Updated: Jul 28, 2023

It started with Zareer giving me a new PRD. It was about payments on UPI ids and via QR codes. After some initial discussions on

  1. how VPA/ UPI ids are generated in our system and

  2. are payments to multiple VPA accounts pointing to the same account even allowed.. ! etc etc..


In the end, only the interesting part remained - generating a QR code for repayments!


After Zareer, the first person to see the PRD with me was Sharat. And following are the major landmarks of QR journey from PRD to PROD (someday), for now a successful pipeline..


  1. Reading through the PRD and finding online tools to generate QR code with UPI IDs. Once we found online tools to do that (actually Sharat found them first :p ), we started looking for APIs to do the same.

  2. That day, Lalitesh was sitting on the next table. When Zareer told him about the QR code piece and that we were trying to find APIs for the QR integration, he said there are open source libraries to do the same. And we do NOT need APIs. I guess you know things like that when you have been on board India’s fintech infrastructure.


And people like me are googling

“What is the difference between a library and an API”?


  1. Then Zareer explained the difference between API and Library. When he explained, I felt, I already knew that. (I did NOT, but in the simple way he explained, library is code that you have added in your codebase, whereas for an API, you call some external code). And we don't need to pay for open source libraries, but we need to make an RPC call for APIs and most probably also pay for them.

  2. The initial discussions happened with MTR, Abhishek and Zareer. Trying to understand how UPI systems work. Where should we put the logic? Frontend/ backend, do we need to store QR etc. And we decided it would be better to do it in frontend. Since we don't really need to store QR codes, and it is manageable in frontend.


  1. Then the piece went silent for 2 weeks, while Zareer clarified requirements with Avanti and Lalit.

  2. After that, he asked me to start looking at libraries to implement it. I had found libraries and tried doing some mini POCs for each. And had figured out how to do it in frontend in the next two weeks, on the side while doing other small things.

  3. For my queries around dart and flutter, and things like how and where we handle events in frontend, I would ping Bismay!

  4. And finally I had a POC ready for QR generation in dart and flutter.



And then it was decided, we should do it on the backend/server. As per some RBI mandate, we need to store QRs. (Imagine listening to that on Monday, after you just spent the weekend implementing it for frontend) :p

But on second thoughts, it was okay. I would know how to do it in the backend too this way.


 

Implementation starting ……


MONDAY

  1. Spoke to Anand- to confirm if we had to really do it on the server side! And then whom I can reach out to when I have questions.. And it was Abhinash. I also told him I was not able to find any working stable Kotlin library, but have found one in JAVA. And he told me, java code can be called in kotlin. (At this point, I have no clue how, but cool :p)

  2. Okay, it felt like it could be done. Now the question was how! So, to brainstorm, I talked to Rahul. I told him the general flow about how QR code is generated and that I am altogether blank on how and where in our server code. Like how the hell would I get a loan topic and its properties in our server and where would I write all that code.


Believe me I have written a predefined function before, and have used tens of them, but it did not strike me.. That we have a handle of topics in predefined functions. And all we need to write is a predefined function for this. (Mujhe nahi chamkaa ye khud se, but again, when he said it, it felt like so obvious.. duhh). I know where and what to do at a high level now..


TUESDAY

  1. Took the next day to figure out the code level flow and trying out the java libraries, standalone, then with our code.. And obviously running into issues. Some for instance

    1. Not able to import jars directly in our code.

    2. And my super fast laptop hanging up on even trying to open the libraries. Discussed it with Abhinash and understood the issue was with my system and not the library.


WEDNESDAY

  1. Next day check with others and then see, we cannot, rather should not add jars in our server code, so I have to figure out a formal library and then try it? (Well, I am still NOT convinced as to why, because ultimately dependency se bhi code download hi hoga server mein, we are in fact saving the call by saving the .jar file?).

So, the day is spent on finding a library and then importing it. Today, Amogh helped me understand where we check libraries from (MavenCentral for one) and what is the difference between different build systems (Maven. Gradle etc.) and I become more comfortable with seeing dependencies in code.


THURSDAY & FRIDAY

  1. Library imports out of the way, now I needed a working function. It took two more days to write the function and some tests. Here, came in Anubhav and Abhishek. Without them I would have gotten lost! I would still be adding code in generated build files and wondering why it disappeared on building :p and would never have thought of simplifying the tests by breaking them into two functions.. And might return values from constructors.. :p

Definitely would not have managed to get it working in 2 days.


I also have a new laptop now. Hopefully my work will be faster. Very grateful to Sharat and Abhijeet for setting it up after work!


WEEKEND

Reach home! And see I still need to get the IDE (IntelliJ) working. To be able to build code! And even though I have written the function, the pipeline is failing. So weekend again is spent in debugging some IDE and installation issues with Sharat and then some more debugging the code on server. :p (Local was still reluctant!) Made a note of all the things I had to check with people on Monday.


Monday

Fixed Local setup! Well, this I did myself! From previous experience! And then for the first time, I saw predefined functions running on my local!

I could make my test case also work now. As long as it told me what the issue was.


And then I was stuck again! In some topic casting between proto type topic and simple topic..


Again, I reached out and this time Rahul obliged! (There needs to be a person you can ask abstract questions to :p). And he looked at my tests! He first told me how to fix the issue. And then waited patiently till we figured out if the fix would work.

The tests were running nicely on master but for some reason not on my branch. Somehow the build I was using for generated topics was outdated or messed up. I could never have figured that out until he explained it. So after many trials, he suggested starting a new branch.. And figure out where it is breaking.


Another hour and this time they passed. I named the branch qrr (‘an extra r for luck and gratitude for the person who helped me get this started and done!’)


 

This is NOT all..

It took two more days for me to merge it!

Had some discussions with Amogh on Java migration from 8 to 17 and best ways to structure our code so that we have to do minimal changes later.

And one more call with Abhinash to discuss some things and further improvements before he finally approved.


I still don’t know some things- like

  1. Why am I NOT able to read QR code filedata from the topic! (Jaise baaki code to mujhe poora samajh aata hai ya maine khud likha hai, chatGPT/youtube/google and existing code dekhkar nahi :p)

  2. And how the hell does the test schema get messed up on adding a new function.


These are open questions I will probably ask Abhishek some time.. :p

And haan, the most important reason why I will remember QR is Abhishek of all reasons..

It is funny!

When I was starting with this PRD- Abhishek off hand roasted me saying - If we give this piece to you, you will consume two engineers bandwidth + yours! Though it is a single engineer’s work. Which was obviously true. 😛


Well, I had hoped to prove him wrong! And I did,

You see, I reached out to five engineers, not just two- Bismay, Rahul, Amogh, Anubhav, Abhishek (indirectly :p)! And Ashwin (He cannot be categorised as Engg/Ops/Product.. I personally have a bias and consider him far more valuable than anyone at Indihood)..


I was also helped by one ops person- Sharat.. Actually two, Gobind too, he found a python library to integrate it, in case java failed us. :p


Then there were always Zareer and Anand and MTR! And this time Lalitesh also directly helped by telling us a library would do.. Plus with the decisions on where we should place this piece, checking RBI compliance stuff etc. Else, imagine one more API integration.


So, if you count the total number of people I managed to rope up, it would be 13 (including me).


So much for my pride for doing it by myself :p

But if I will be honest, I take far more pride in being a part of this team or family. Where everyone is so nice. Where people are nice.. and genuinely happy to help each other. And work as a team.. And I have Krishna ji to thank for that. Thankyou, thankyou, thankyou.. sab ke liye .. Dekh lena aage bhi please :)


I am grateful to everyone I mentioned above. But a bit more to


Ashwin. In general, he is the first person I will ask something before asking anyone else. :p.. To feel less silly.. And, the same goes for QR piece. Apart from the big and small queries and discussions which I usually have with him, I took a lot of help from his image stitching CL on how to handle images in general. And for fixing most of the issues I would have faced otherwise (Believe me, I would have taken forever to even find the root cause of most of them, let alone fixing them):p So, official credits :p!


And most of all

I owe it to Zareer, for not once making me feel incompetent even though I was -

  1. He knew he was giving it to a person who could not tell apart an API and a library,

  2. He knew I wouldn't be able to do it alone, and never minded that, in fact he helped whenever I asked for it.

  3. He gave it to me, only because I said I want to do it. So, he acted as a perfect manager and did everything to get it done.. :)


So, all's well that ends well! See you on Prod, Dear QR code. Hope you bring us more business and more wealth and more luck!


-twwg


PS - Dekh kya rahe ho! scan this QR code and send me money now, if you enjoyed reading the above :D



 
 
 

Opmerkingen


  • Facebook
  • Instagram
bottom of page