Skip to content

Instantly share code, notes, and snippets.

View ramanathanrv's full-sized avatar

Ramanathan RV ramanathanrv

View GitHub Profile
@ramanathanrv
ramanathanrv / sls
Created November 22, 2020 08:06
Simple Ledger System
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
Online Offline
Card Card
UPI UPI
Prepaid wallets Prepaid wallets
Netbanking
IMPS
NEFT

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:

PhonePe

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.

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
ramanathanrv / juspay_example.cs
Last active February 15, 2019 09:29
Example C# code to connect with JusPay APIs
using System;
using System.Net;
using System.IO;
using System.Text;
public class JusPayService
{
public static void Main()
{
String apiKey = "1C3CB0373660436BA2895B6CC74629E7";
@ramanathanrv
ramanathanrv / groovy
Created November 29, 2018 10:02
frp implementation sample
public Observable triggerChallenge(final SecondFactor secondFactor) {
def handleSuccess = {resJson->
log.info("Challenge triggered successfully")
secondFactor.status = SecondFactor.SecondFactorStatus.PENDING
return secondFactor
}
def handleFailure = {resJson->
log.info("Challenge trigger failed")
secondFactor.status = SecondFactor.SecondFactorStatus.FAIL
// changing txnDetail here is a contamination.
@ramanathanrv
ramanathanrv / card.js
Created October 29, 2018 10:39
Card JS react
<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}
components={components}
wrapUsing={FullRow}
stitchUsing = {FormControl}
onChange={this.handleInput} stitcherClass="cardsInputinfo cardNumber" />
<Block>
<TextInput prompt="Expiry" name="cc-exp-month" placeholder="MM"
@ramanathanrv
ramanathanrv / example_switching_dsl_for_axis.groovy
Created April 18, 2017 08:58
example_switching_dsl_for_axis
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
ramanathanrv / gateway_routing_logic_samples
Last active February 15, 2017 17:35
Routing Logic for choosing the best gateway to handle your transaction
// WARNING: This code is a sample to test your logic of gateway priority. This is NOT to be used as such.
def order = [order_id: "ord_id", amount: 1000.00, udf1:"web", udf2: "desktop", gateway_id: 2]
def txn = [txn_id: "txn_id", express_checkout: true, add_to_locker: false ]
def payment = [card_isin: "524368", card_issuer: "HDFC Bank", card_type: "CREDIT"]
def setGatewayPriority = { gateways ->
println "priority: " + gateways;
}
@ramanathanrv
ramanathanrv / static_bank_info.json
Created January 8, 2017 18:01
Static Bank Info UAT & Prod
module.exports = {
banks: [
{
"shortCode": "SBI",
"IFSC":"SBIN",
"numericCode": "41",
"name": "State Bank of India",
"contains": "STATE.*INDIA"
},
{