Implementing Signature Capture
You need to provide
UI for signature capture. The SDK tells you which method to show by calling the
onCustomerSignatureRequired
or the
onCustomerVerificationRequired
on your
TransactionProcessListener
:
@Override
public void onCustomerSignatureRequired(TransactionProcess process,
Transaction transaction) {
// in a live app, this image comes from your signature screen
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Bitmap bm = Bitmap.createBitmap(1, 1, conf);
// Submit the signature digitally as part of the transaction
byte[] signature = SignatureHelper.byteArrayFromBitmap(bm);
process.continueWithCustomerSignature(signature, true);
// Or alternatively if you would like to collect the signature on the printed receipt
// process.continueWithCustomerSignatureOnReceipt();
}
@Override
public void onCustomerVerificationRequired(TransactionProcess process,
Transaction transaction) {
// always return false here
process.continueWithCustomerIdentityVerified(false);
}
}
The SDK will compress each signature image that you send. To avoid errors during
the compression process because of large signature images or unsupported image
formats. we recommend the submitted signature images follow these guidelines:
Dimensions similar to the target image size of 960x720 pixels
JPEG or PNG image format
Greyscale image
If the submitted signature image causes an error (due to unsupported image
format or size), that will result in the TRANSACTION_ACTION_ERROR error type.
The merchant hands the device to the
customer. The customer either signs on the screen and approves the payment, or
cancels the transaction. If the customer signs, the merchant compares the signature
on the screen and on the card.