Skip to content

Instantly share code, notes, and snippets.

View ramanathanrv's full-sized avatar

Ramanathan RV ramanathanrv

View GitHub Profile
ramanathanrv / sls
Created November 22, 2020 08:06
Simple Ledger System
View sls
touch account:s1, type:source, value:1000
touch account:s2, type:sink , value:0
touch account:a1, type:regular
issue from:s1, to:a1, value:200, remarks:coins issue
touch account:a2, type:regular
issue from:a1, to:a2, value:100, remarks:coins issue
move from:a1, to:a2, value:10, remarks:a2a transfer for something
View payment_methods.csv
Online Offline
Card Card
Prepaid wallets Prepaid wallets

Why I believe Google Pay is ahead of Paytm and PhonePe in the UPI race

Recent reports have indicated that all three major UPI apps - Paytm, PhonePe & Google Pay have been contributing significantly to the growth of the app. A million dollar question is: who is leading the race! Paytm seems to have an edge over the other two albeit with a thin margin. However, I would like to evaluate it with more context. Paytm and PhonePe have been doing much more than just facilitate P2P and P2M UPI transactions. For context, here are some of the key things that PhonePe and Paytm have been doing to drive greater volume of UPI transactions:


1) Flipkart / Myntra contribution

Significant number of transactions originating in Flipkart & Myntra are handled by PhonePe as they all belong to the same group of companies. GooglePay or other UPI options don’t get any preferential treatment by these two mega e-commerce companies.

View gist:1364b92edc32b40c2449306880df197b
Strategy Throughput (under similar test conditions) Trade off
#0 Cluster of nodes with Redis backend & 100% accurate 58K requests/sec (can be scaled out as required with additional hardware) Higher hardware cost & hardware footprint (linearly increasing)
#1 Use a single node to count & report 833K requests/sec Not HA. Can only scale up (not scale out)
#2 Use cluster of nodes but sync with Redis asynchronously 655K requests/sec Reporting is not realtime and hence solution is approximate rather than accurate
ramanathanrv / groovy
Created November 29, 2018 10:02
frp implementation sample
View groovy
public Observable triggerChallenge(final SecondFactor secondFactor) {
def handleSuccess = {resJson->"Challenge triggered successfully")
secondFactor.status = SecondFactor.SecondFactorStatus.PENDING
return secondFactor
def handleFailure = {resJson->"Challenge trigger failed")
secondFactor.status = SecondFactor.SecondFactorStatus.FAIL
// changing txnDetail here is a contamination.
ramanathanrv / card.js
Created October 29, 2018 10:39
Card JS react
View card.js
<form className="card-form">
<FullRow style={{marginBottom: '20px'}}>Please enter your card details below. Card transaction is processed via secure gateway.</FullRow>
<CardIconsBanner brands={this.state.acceptedCardBrands}/>
<TextInput prompt="Card number" name="cc-number" value={this.state.cardNumber}
stitchUsing = {FormControl}
onChange={this.handleInput} stitcherClass="cardsInputinfo cardNumber" />
<TextInput prompt="Expiry" name="cc-exp-month" placeholder="MM"
ramanathanrv / example_switching_dsl_for_axis.groovy
Created April 18, 2017 08:58
View example_switching_dsl_for_axis.groovy
def priorities = ['CYBERSOURCE', 'MIGS']
// above is the default priority
if (order.udf1 == 'web') {
priorities = ['CYBERSOURCE', 'MIGS']
else if (order.udf1 == 'mobile' && order.udf2 == 'android')
priorities = ['MIGS','CYBERSOURCE']
else if (card.cardSwitchProvider == 'MASTERCARD') {
ramanathanrv / static_bank_info.json
Created January 8, 2017 18:01
Static Bank Info UAT & Prod
View static_bank_info.json
module.exports = {
banks: [
"shortCode": "SBI",
"numericCode": "41",
"name": "State Bank of India",
"contains": "STATE.*INDIA"
View bank_list_uat.json
"banks": [
"id": "a_1d24cc0c7e111e6b48cdb9794d0ea8",
"active": "Y",
"ifsc": "ALLA",
"iin": "607117",
"name": "allahabad bank",
"upiEnabled": "false",
"commonAppEnabled": true,
ramanathanrv / juspay_example.cs
Last active February 15, 2019 09:29
Example C# code to connect with JusPay APIs
View juspay_example.cs
using System;
using System.Net;
using System.IO;
using System.Text;
public class JusPayService
public static void Main()
String apiKey = "1C3CB0373660436BA2895B6CC74629E7";