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
|
| handler |
referenceNmber
|
| 12345678 |
Mobile No
|
| 9000000000 |
Email id
|
| |
Transaction type
|
| MICRO_ATM |
Sample request
try {
PaymentInitialization initialization = new PaymentInitialization(
getApplicationContext());
initialization.initiateVoidTransaction(voidHandler,txnResponse.getReferenceNumber()
,null,null);
} catch (RuntimeException e) {
e.printStackTrace();
}Response parameters
| Parameter | Description |
|---|---|
| Success | If the Email/SMS sent, then it displays success. |
| Fail | If 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();
}
};
};