HemangNirmal HemangNirmal - 9 days ago 8
Android Question

Hash param is missing in payU payment gateway android integration

I need to integrate payU payment gateway in my android app. But when app is trying to to get hash key it gives me error saying that

Hash param is missing

In demo app there are two option to generate hash

if(null == salt)
generateHashFromServer(mPaymentParams);
else
generateHashFromSDK(mPaymentParams, intent.getStringExtra(PayuConstants.SALT));


In demo app there are note saying that hash key generation should be done
on server side

so I am passing salt as null

but Now the question is Which server url I have to use to generate hash?
Demo app is using this url
https://payu.herokuapp.com/get_hash

Answer

I got solution by doing little search.

Just generate all required hashes using own server. After getting all required hashes we need to make PayuHashes Obj using this hashes and pass this Obj in intent like this

Intent intent= new Intent(this, PayUBaseActivity.class);
intent.putExtra(PayuConstants.PAYU_CONFIG, payuConfig);
intent.putExtra(PayuConstants.PAYMENT_PARAMS, mPaymentParams);
intent.putExtra(PayuConstants.PAYU_HASHES, payuHashes);
intent.putExtra(PayuConstants.SALT, salt);

PayU SDK will take care of rest