Skip to content

Instantly share code, notes, and snippets.

@ramanathanrv
Created August 26, 2014 10:46
Show Gist options
  • Save ramanathanrv/17d93171a47a2f7ebd4e to your computer and use it in GitHub Desktop.
Save ramanathanrv/17d93171a47a2f7ebd4e to your computer and use it in GitHub Desktop.
Payment Details for Juspay Browser Fragment
import in.juspay.godel.core.PaymentDetails;
// setup the initial parameters for the browser fragment
PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setOrderId(rechargeRequest.getPaymentId());
paymentDetails.setMerchantId("juspay_recharge");
// clientId uniquely identifies the weblab configuration rules to apply
paymentDetails.setClientId("juspay_recharge_android");
// customerId uniquely identifies a customer
paymentDetails.setCustomerId(rechargeRequest.getMobileNumber());
paymentDetails.setDisplayNote(String.format("Recharging %s for Rs. %s", rechargeRequest.getMobileNumber(),
rechargeRequest.getAmount()));
paymentDetails.setRemarks(String.format("Recharging %s for Rs. %s", rechargeRequest.getMobileNumber(),
rechargeRequest.getAmount()));
paymentDetails.setAmount(rechargeRequest.getAmount());
paymentDetails.setCustomerEmail("");
paymentDetails.setCustomerPhoneNumber(rechargeRequest.getMobileNumber());
Map<String, String> extraParams = new HashMap<String, String>();
// include any extra parameters that needs tracking
extraParams.put("operator", rechargeRequest.getOperator());
extraParams.put("circle", rechargeRequest.getCircle());
extraParams.put("type", "prepaid");
paymentDetails.setExtraParams(extraParams);
// finally set all the information on browser fragment.
browserFragment.setPaymentDetails(paymentDetails);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment