Implement Signature

You need to provide UI for signature capture. The SDK tells you which method to show in the actionRequired block.

actionRequired:^(MPTransactionProcess *process,
                            MPTransaction *transaction,
                            MPTransactionAction action,
                            MPTransactionActionSupport *support)
{
    switch (action) {
        case MPTransactionActionCustomerSignature: {
            NSLog(@"show a UI that let's the customer provide his/her signature!");
            // In a live app, this image comes from your signature screen
            UIGraphicsBeginImageContext(CGSizeMake(1, 1));
            UIImage *capturedSignature = UIGraphicsGetImageFromCurrentImageContext();
            UIGraphicsEndImageContext();

            [process continueWithCustomerSignature:capturedSignature verified:YES];
            break;
        }
        case MPTransactionActionCustomerIdentification: {
            // always return NO here
            [process continueWithCustomerIdentityVerified:NO];
            break;
        }
        default: {
            break;
        }
    }
}

Signature

The merchant hands the device to the customer. The customer either signs and accepts, or cancels. Then, the merchant compares the signature on the screen and on the card. We provide an open source signature screen. Once you have the signature, continue the transaction:

[process continueWithCustomerSignature:capturedSignature verified:YES];

Make sure to add a cancel button to enable the shopper to abort the transaction. If he presses cancel, continue the transaction like this:

[process continueWithCustomerSignature:nil verified:NO];

You need to provide UI for signature capture. The SDK tells you which method to show by calling onCustomerSignatureRequired or 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);
    process.continueWithCustomerSignature(bm, true);
    // 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);
}
}

Signature

The merchant hands the device to the customer. The customer either signs and accepts, or cancels. Then, the merchant compares the signature on the screen and on the card and compares them.

Can we help you?

If you cannot find your answer, contact us and we'll get in touch with you soon.

© Copyright 2017 Payworks GmbH. Legal.