Core

Consists of all the Core sdk components and implementation.

Getting Started

PayU Android SDK version 3.0 is deprecated.We are no longer supporting it.

Add below dependency in your application's build.gradle to get started

implementation 'com.payu.india:payu-sdk:4.5.0'

Payment Request Generation

To create a Payment Request you would first need to create an object of PaymentParams.

Creating PaymentParams

Create an object of PaymentParams, put all the obtained parameters in it by using its default set methods an object of PaymentParams

PaymentParams mPaymentParams = new PaymentParams();
mPaymentParams.setKey(<Your Key issued by PayU>);
mPaymentParams.setAmount(<Transaction Amount>);
mPaymentParams.setProductInfo(<Product Description>);
mPaymentParams.setFirstName(<Customer First Name>);
mPaymentParams.setEmail(<Customer Email>);
mPaymentParams.setTxnId(<Transaction Id>);
mPaymentParams.setSurl(<Success URL>);
mPaymentParams.setFurl(<Failure URL>);
mPaymentParams.setUdf1(<User Defined Fields>);
mPaymentParams.setUdf2(<User Defined Fields>);
mPaymentParams.setUdf3(<User Defined Fields>);
mPaymentParams.setUdf4(<User Defined Fields>);
mPaymentParams.setUdf5(<User Defined Fields>);

Information for creating PaymentParams

  • You don't need to set udf1-5 in case you are not using them.

  • Email and First name can be empty strings "" if you don't want to use them

  • For store user card feature, you need to pass user_credentials as below:

mPaymentParams.setUserCredentials("your_key:user_id")

  • For offers mPaymentParams.setOfferKey("your_offer_key")

  • For any other payment default param (like phone and others)

mPaymentParams.setPhone(<Customer's Phone number>)

Get the required hashes by using your own server. Create an object of class PayuHashes and set the corresponding hashes using the default set methods provided.

mPaymentParams.setHash(payuHashes.getPaymentHash());

Creating Payment Post Data

To create Payment PostData you need to pass the Payment Type from SDK's supported payment options.

PostData postData = new PaymentPostParams(mPaymentParams, <Payment Type>).getPaymentPostParams();