EMI Transaction

Method: POST

Pass the parameters mentioned in the request parameters table with this method to initiate an EMI Transaction.\

Request parameters

ParameterDescriptionExample
Handler

mandatory
handler Handlers are used for sending and receiving the data within the two classes.handler
Device type

mandatory
string The name of the bluetooth of the respective deviceDeviceType.ME30S
Address

mandatory
string The bluetooth address incase of MAC devices.
Amount
mandatory
string The amount that is being transacted.11.00
Transaction type

mandatory
string The type of the transaction.PaymentTransactionConst ants.SALE/EMI
Payment Type

mandatory
string Type of payment is POS for Mobile POS devices.(PayU have multiple payment types like POS,Wallet,qr.)PaymentTransactionConst ants.POS
Mobile Number
Optional
string The mobile number of the customer.9000000000
Name
Optional
string The name of the customer.
Latitude
Optional
double Geolocation where the transaction took place.71.000001
Longitude
Optional
double Geolocation where the transaction took place.17.0000001
Merchant reference number

mandatory
string Merchant Invoice Reference Number or pass current date time stamp. [Max upto 40 characters ]123456
Cash back amount

Optional
string Pass cash back amount only for SALE WITH CASH BACK
transaction type otherwise pass null value.
null
deviceCommMode

Optional
int Select device communication mode. It’s only applicable for QPOS device rest all devices can be ‘N’.DeviceCommunicationMode.BLUETOOTHCOMMUNICATION
orderReferenceNo

Optional
string Order reference no (only for PayUs internal apps)
appName

Optional
string The name of the app.
appVersion
Optional
string The version of the app.
EMI
mandatory
objectComplete details about EMI
transaction.
REFER SECTION8.5

Sample request

initialization.getSelectedBankEMITenureList(selectedbankhandler, amount,
selectedBankDetails);

Response Parameter

ParameterDescriptionExample
ICCTransactionRes
ponse
objectICCTransactionRespons returns a list of transaction details such as transactionStatus, responseMessaege etc.Refer to ICCTransactionResponse payload objects.

Sample response

Use this code to fetch the response of this API.

@SuppressLint("HandlerLeak")
private final Handler handler = new Handler()
	{
		public void handleMessage(android.os.Message msg)
			{
				checkFlag = true;
				if (msg.what == SOCKET_NOT_CONNECTED)
				{
					alertMessage((String) msg.obj);
				}
				else if (msg.what == QPOS_ID)
				{
					Toast.makeText(PaymentTransactionActivity.this, (String) msg.obj,
						Toast.LENGTH_LONG).show();
				}
				else if (msg.what == CHIP_TRANSACTION_APPROVED ||
					msg.what == SWIP_TRANSACTION_APPROVED)
				{
					ICCTransactionResponse iCCTransactionResponse = (ICCTransactionResponse)
					msg.obj;
					if (iCCTransactionResponse.isSignatureRequired())
					{
						Intent i = new Intent(PaymentTransactionActivity.this,
							SignatureCaptureActivity.class);
						i.putExtra("vo", iCCTransactionResponse);
						//mpaysdk 2.0
						i.putExtra("paymentType", paymentType);
						finish();
						PaymentTransactionActivity.this.startActivity(i);
					}
					else
					{
						Intent i = new Intent(PaymentTransactionActivity.this,
							TransactionDetails.class);
						i.putExtra("vo", iCCTransactionResponse);
						//mpaysdk 2.0
						i.putExtra("paymentType", paymentType);;
						f
						inish();
						PaymentTransactionActivity.this.startActivity(i);
					}
				}
				else if (msg.what == CHIP_TRANSACTION_DECLINED ||
					msg.what == SWIP_TRANSACTION_DECLINED)
				{
					ICCTransactionResponse vo = (ICCTransactionResponse) msg.obj;
					Intent i = new Intent(PaymentTransactionActivity.this,
						TransactionDetails.class);
					i.putExtra("vo", vo);
					i.putExtra("paymentType", paymentType);
					PaymentTransactionActivity.this.startActivity(i);
					Toast.makeText(PaymentTransactionActivity.this, "Transaction Status : " +
						vo.getResponseCode() + ":" + vo.getResponseMessage(), Toast.LENGTH_LONG).show();
					finish();
				}
				else if (msg.what == QPOS_DEVICE)
				{
					alertMessage((String) msg.obj);
				}
				else if (msg.what == TRANSACTION_FAILED)
				{
					ICCTransactionResponse vo = (ICCTransactionResponse) msg.obj;
					if (paymentType.equalsIgnoreCase(EMI))
					{
						Intent i = new Intent(PaymentTransactionActivity.this,
							TransactionDetails.class);
						i.putExtra("vo", vo);
						i.putExtra("paymentType", paymentType);
						PaymentTransactionActivity.this.startActivity(i);
						Toast.makeText(PaymentTransactionActivity.this, "Transaction Status :
							" + vo.getResponseCode() + ": " + vo.getResponseMessage(), Toast.LENGTH_LONG).show();
							finish();
						}
						else
						{
							Toast.makeText(PaymentTransactionActivity.this, "Transaction Status :
								" + vo.getResponseCode() + ": " + vo.getResponseMessage(), Toast.LENGTH_LONG).show();
								finish();
							}
						}
						else if (msg.what == TRANSACTION_INITIATED)
						{
							Toast.makeText(PaymentTransactionActivity.this, msg.obj.toString(),
								Toast.LENGTH_LONG).show();
						}
						else if (msg.what == ERROR_MESSAGE)
						{
							alertMessage((String) msg.obj);
						}
						else if (msg.what == TRANSACTION_PENDING)
						{
							Toast.makeText(PaymentTransactionActivity.this,
								(String) msg.obj + "Pending status", Toast.LENGTH_SHORT).show();
							finish();
						}
						else if (msg.what == DISPLAY_STATUS)
						{
							Toast.makeText(PaymentTransactionActivity.this,
								(String) msg.obj, Toast.LENGTH_SHORT).show();
						}
						else if (msg.what == QPOS_EMV_MULITPLE_APPLICATION)
						{
							ArrayList<String> applicationList = (ArrayList < String>) msg.obj;
							emvList = (ListView) findViewById(R.id.application_list);
							emvList.setVisibility(View.VISIBLE);
							ArrayAdapter<String> adapter = new
							ArrayAdapter<String> (PaymentTransactionActivity.this,
								android.R.layout.simple_list_item_1, applicationList);
							emvList.setAdapter(adapter);
							emvList.setOnItemClickListener(new OnItemClickListener()
							{
								@Override
								public void onItemClick(AdapterView<? > parent, View view,
									int position, long id)
								{
									if (initialization != null)
									{
										initialization.getQposListener().executeSelectedEMVApplication(position);
										emvList.setVisibility(View.GONE);
									}
								} });
						}
						else if (msg.what == SUCCESS)
						{
							Toast.makeText(PaymentTransactionActivity.this,
								(String) msg.obj, Toast.LENGTH_SHORT).show();
							Intent i = new Intent(PaymentTransactionActivity.this,
								MainActivity.class);
							finish();
							PaymentTransactionActivity.this.startActivity(i);
						}
					}