Skip to content

Instantly share code, notes, and snippets.

@ramanathanrv
Created November 28, 2014 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramanathanrv/d346f328c9f327e3d87f to your computer and use it in GitHub Desktop.
Save ramanathanrv/d346f328c9f327e3d87f to your computer and use it in GitHub Desktop.
Code for deciding gateway priority.
// available variables order, txn, payment
def priorities = ["HDFC", "ICICI"] // default
if (payment.card_issuer == "ICICI Bank") { // if ICICI Bank card, use ICICI
priorities = ["ICICI", "HDFC"]
}
else if (order.udf1 == "mobile" && order.udf2 == "android") // for android transactions, use ICICI
priorities = ["ICICI","HDFC"]
}
setGatewayPriority(priorities)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment