Signature Capture API

The Signature Capture API is used to capture the signature from the customer based on the PinVerifiedFlag parameter. When the PinVerifiedFlag is false then this API collects the signature from the customer and send it to SDK.

Method: POST

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

Request parameters

ParameterDescriptionSample
Handler object

mandatory
handlerhandler Create a handler inner class. This class will return response messagehandler
Ref.No

mandatory
stringPass Transaction reference number which returns from initiateTransaction response.Refer to <<ICCTransactionResponse>> payload objects.
Signature
mandatory
byte signature for transaction confirmation.

Sample request

try
{
	Bitmap bitmap = BitmapFactory.decodeFile(SignatureCaptureActivity.this.getFilesDir()
		.getPath() + SIGNATURE);
	PaymentInitialization initialization = new PaymentInitialization(SignatureCaptureActivity.this);
	initialization.initiateSignatureCapture(handler,
		iccTransactionResponse.getReferenceNumber(), UtilManager.convertBitmapToByteArray(bitmap));
}
catch (RuntimeException e)
{
	e.printStackTrace();
}

Response parameters

ParameterDescriptionExample
ResponseobjectResponse returns the details of response objects such as response code,response messaege etc.Refer to Response payload objects.

Sample response

Use this code to fetch the response of the API.

private final Handler handler = new Handler()
{
	public void handleMessage(android.os.Message msg)
	{
		if (msg.what == SUCCESS)
		{
			Toast.makeText(SignatureCaptureActivity.this, getString(R.string.success),
				Toast.LENGTH_LONG).show();
			Intent i = new Intent(SignatureCaptureActivity.this,
				TransactionDetails.class);
			i.putExtra("vo", iccTransactionResponse);
			finish();
			SignatureCaptureActivity.this.startActivity(i);
		}
		else if (msg.what == FAIL)
		{
			Toast.makeText(SignatureCaptureActivity.this, (String) msg.obj,
				Toast.LENGTH_LONG).show();
		}
		else if (msg.what == ERROR_MESSAGE)
		{
			Toast.makeText(SignatureCaptureActivity.this, (String) msg.obj,
				Toast.LENGTH_LONG).show();
		}
	};
};