PayUmoney offers electronic payment service to your website through its various partnerships with banks and payment instrument companies. Through PayUmoney, Our clients would be able to make electronic payments through credit card, debit card, and online net banking account.
How to integrate PayU money in android app?
- Download SDK from the following link- https://www.payumoney.com/payment-gateway-integration-guide.html
- Import and add SDK dependency in our app.
- Once you add the SDK as the module you will need to call the following function from the app when the user clicks on Pay Now button on your app.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
PayUmoneySdkInitilizer.PaymentParam.builderbuilder = new PayUmoneySdkInitilizer.PaymentParam.Builder() .setMerchantId("XXXXXX") .setKey("YYYYYYYY") .setIsDebug(true) // for Live mode - setIsDebug(false) .setAmount(amount) .setTnxId("0nf7" + System.currentTimeMillis(); .setPhone("8882434664") .setProductName("product_name") .setFirstName("piyush") .setEmail("test@payu.in") .setsUrl("https://www.PayUmoney.com/mobileapp/PayUmoney/success.php") .setfUrl("https://www.PayUmoney.com/mobileapp/PayUmoney/failure.php") .setUdf1("") .setUdf2("") .setUdf3("") .setUdf4("") .setUdf5("") |
- Set Hash key
1paymentParam.setMerchantHash(hash);
hash key is generated by using SHA-512 algorithms.
123String hashSequence =key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|salt;String serverCalculatedHash = hashCal("SHA-512", hashSequence);
- Call SDK initializer Activity from your Activity
1PayUmoneySdkInitilizer.startPaymentActivityForResult(MainActivity.this, paymentParam);
References: PayUmoney SDK documents.