Cancel Card Read (On Demand)

This method cancels an on-demand card read operation that is in-progress.

error_outline
note

This method requires the following:

  • a valid connected ROAM card reader
  • a in-progress on-demand card read operation
  • an Android or iOS POS

ROAM readers (including Moby) only support on-demand cancel read for Android and iOS.

Code Samples

Java

You need to set up an ECLCardReaderCancelRetrieveCardDataListener to handle callbacks during the on-demand cancel card read operation.

private ECLCardReaderInterface _cardReaderInterface;

// finding available card reader and initilizaing _cardReaderInterface
...

public void _cancelCardDataRetrieval()
{
    _cardReaderInterface.cancelRetrieveCardData(new ECLCardReaderCancelRetrieveCardDataListener()
    {
        @Override
        public void cardReaderCancelRetrieveCardDataDidSucceed(ECLCardReaderInterface cardReader)
        {
            //handle successful cancel operation
        }

        @Override
        public void cardReaderCancelRetrieveCardDataDidFail(ECLCardReaderInterface cardReader, final ECCError eccError)
        {
            //handle failed cancel operation
        }
    });
}

Objective-C

You need to set up a delegate to implement ECLCardReaderCancelRetrieveCardDataDelegate and pass it to cancelRetrieveCardData function of card reader protocol.

[cardReader cancelRetrieveCardData:delegate];

...

+ (void)cardReaderCancelRetrieveCardDataDidSucceed:(id<ECLCardReaderProtocol>)cardReader {
    //handle successful cancel operation
}

+ (void)cardReaderCancelRetrieveCardDataDidFail:(id<ECLCardReaderProtocol>)cardReader error:(NSError *)error {
    //handle failed cancel operation
}