I have integrate PayUMoney with my android app, transaction is working fine, but I am not getting any response data, I have to perform some operation based of the status of the payment transaction (On Success I have to perform some operation & On Failure I have to perform some other operation).
Here is my code
private void callPayUGateway(String toBePaid, String firstName, String mobileNo, final String emailId) {
PayUmoneyConfig payUmoneyConfig = PayUmoneyConfig.getInstance();
payUmoneyConfig.setDoneButtonText("Continue");
payUmoneyConfig.setPayUmoneyActivityTitle("PayUMoney");
String txnId = System.currentTimeMillis() + "";
String productName = "product_name";
String salt = "nrn0cqVgkH";
String marchantId = "5000051";
String marchantKey = "mJ0vrJ0Z";
PayUmoneySdkInitializer.PaymentParam.Builder builder = new PayUmoneySdkInitializer.PaymentParam.Builder();
builder.setAmount(Double.parseDouble(toBePaid))
.setTxnId(txnId)
.setPhone(mobileNo)
.setProductName(productName)
.setFirstName(firstName)
.setEmail(emailId)
.setsUrl("https://www.payumoney.com/mobileapp/payumoney/success.php")
.setfUrl("https://www.payumoney.com/mobileapp/payumoney/failure.php")
.setUdf1("")
.setUdf2("")
.setUdf3("")
.setUdf4("")
.setUdf5("")
.setUdf6("")
.setUdf7("")
.setUdf8("")
.setUdf9("")
.setUdf10("")
.setIsDebug(false)
.setKey(marchantKey)
.setMerchantId(marchantId);
try {
mPaymentParams = builder.build();
HashMap<String, String> params = mPaymentParams.getParams();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(params.get(PayUmoneyConstants.KEY) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + "|");
stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + "||||||");
//salt
stringBuilder.append(salt);
final String hash = hashCal(stringBuilder.toString());
if (!hash.isEmpty()) {
mPaymentParams.setMerchantHash(hash);
if (AppConstants.selectedTheme != -1) {
PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams, CheckoutActivity.this, AppConstants.selectedTheme, appConstants.isOverrideResultScreen());
} else {
PayUmoneyFlowManager.startPayUMoneyFlow(mPaymentParams, CheckoutActivity.this, R.style.AppTheme_default, appConstants.isOverrideResultScreen());
}
}
} catch (Exception e) {
Toast.makeText(CheckoutActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
Please help me on this.
You need to request all the parameters. Here is the code how to request parameters in .NET with C# You can change the code according to the platform