Skip to content

Instantly share code, notes, and snippets.

Ramanathan RV ramanathanrv

Block or report user

Report or block ramanathanrv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

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 Nov 29, 2018
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.
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"
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 Jan 8, 2017
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 Feb 15, 2019
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";
View paytm_account_types.html
<p>Please check with your PayTM RM on the account type</p>
<li>Express - This is the latest offering from PayTM. Supports cards, netbanking & PayTM wallet as well.</li>
<li>Seamless - Supports card acceptance only. (For netbanking, its redirection based)</li>
<li>Wallet - Only wallet transactions are permitted</li>
ramanathanrv /
Created May 26, 2016
Calculate HMAC SHA-256 for a given message
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public String calculateSignature() {
String secretKey = "<insert secret key here>";
String serialized = "order_id=1464092311945&status=CHARGED&status_id=21";
String algorithm = "HmacSHA256";
serialized = URLEncoder.encode(serialized);
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(), algorithm);
You can’t perform that action at this time.