Send SMS and Email API

The Send SMS and Email API is used to send the details of a transaction over SMS and email.

Method: POST

Create a PaymentInitialization class object and call sendSMSEmail() method by passing the
parameters mentioned in the request table.

Request parameter

Parameter

Description

Sample

Handler object
 mandatory

handler Create a handler inner class. This class will return response message.

handler

referenceNmber

mandatory

string Pass the reference number after the transaction response.

12345678

Mobile No

mandatory

string The mobile Number of the customer

9000000000

Email id

mandatory

string The email Id of the customer.

[email protected]

Transaction type

mandatory

string Type of the transaction (Available inside PaymentTransactionConstants)

MICRO_ATM

Sample request

try {
PaymentInitialization initialization = new PaymentInitialization(
getApplicationContext());
initialization.initiateVoidTransaction(voidHandler,txnResponse.getReferenceNumber()
,null,null);
} catch (RuntimeException e) {
e.printStackTrace();
}

Response parameters

ParameterDescription
SuccessIf the Email/SMS sent, then it displays success.
FailIf Email/SMS is not sent, then it is failed. (Due to network issues).

Sample response

Use this code to fetch the response of the API.

@SuppressLint("HandlerLeak")
private final Handler handler = new Handler() {
public void handleMessage(android.os.Message msg) {
if (msg.what == SUCCESS) {
Toast.makeText(SendSMSEmail.this, getString(R.string.success),
Toast.LENGTH_LONG).show();
finish();
} else if (msg.what == FAIL) {
Toast.makeText(SendSMSEmail.this, (String) msg.obj,
Toast.LENGTH_LONG).show();
finish();
} else if (msg.what == ERROR_MESSAGE) {
Toast.makeText(SendSMSEmail.this, (String) msg.obj,
Toast.LENGTH_LONG).show();
finish();
}
};
};