Before proceeding with payment via OlaMoney payment mode merchant must check whether the customer is eligible for OlaMoney or not by using below method.
where object of PayUOlaMoneyParams can be created like below.
Kindly note that values that are set in PayUOlaMoneyParams must be the same that needs to be sent to PayU's backend in payment post-data.
Creating PayUOlaMoneyParams
PayUOlaMoneyParams payUOlaMoneyParams = new PayUOlaMoneyParams();
payUOlaMoneyParams.setMobile(<Customer Mobile number>));
payUOlaMoneyParams.setFirstName(<Customer Firstname>);
payUOlaMoneyParams.setTxnId(<TransactionId>);
payUOlaMoneyParams.setMerchantKey(<PayU Merchant key>);
payUOlaMoneyParams.setHash(<Hash generated for OlaMoney Eligibility check>);
payUOlaMoneyParams.setAmount(<Amount that customer needs to pay>);
where OlaMoney eligibility hash can be created as below
OlaMoney Eligibility Hash Generation
To generate OlaMoney eligibility hash use below method
sha512(key|command|var1|salt)
where
Key - Merchant Key
Command - get_eligible_payment_options
var1 - {\"amount\":\"<Transaction Amount>",\"txnid\":\"<Transaction Id>\",\"mobile_number\":\"<Customer Phone Number>",\"first_name\":\"<Customer first name>\",\"bankCode\":\"OLAM\",\"email\":\"<Customer's email>\",\"last_name\":\"<Customer's last name>\"}
Order of the fields should be the same written here.
Salt - Merchant's Salt
Ordering of the fields of var1 should be the same written above.
amount: Amount that buyer needs to pay.
txnid: Merchant generated Transaction id for the order.
mobile_number: The buyer mobile number for OlaMoney Payment.
first_name: Buyer first name.
bankCode: It must be OLAM.
email: Buyer Email ID. Not mandatory If don’t have, send blank "".
last_name: Buyer Last name. Not mandatory If don’t have, send blank "".