Archive

Archive for the ‘Devices’ Category

MEI Cash Acceptor with Bunch Note Feeder

August 29, 2009 Abhijeet Iraj Leave a comment

Frankly speaking i had never used cash acceptor in my life since in India that technology is not used much. But recently i got a chance to integrate MEI CASHFLOW® SC Series note acceptor with BNF in our system at work and it was really a nice experience. This is one of the world’s most technically advanced cash acceptor.

Cash Acceptor

Because of bunch note feeder (BNF) user can deposit cash more efficiently by placing a bundle of up to 30 notes into a BNF.

Before starting integration, one thing which was really important was to change MEI Cash Acceptor from Stand-Alone mode to EBDS mode. In Stand-Alone mode the communication between the SC and API will not work.

Integration using MEI provided java api was straightforward..

/**
 * @author airaj
 *
 */
public class MEICashAcceptor extends CashAcceptor
                                           implements AcceptorEventListener
{
    // serial port to which device is connected
    private String serialPort = "/dev/ttyS3";

    private Acceptor cashAcceptor = null;

    // connect to the device
    public void connect()
    {
        cashAcceptor = new Acceptor();
        cashAcceptor.addAcceptorEventListener(this);
        Acceptor.listPorts();
        try
        {
            cashAcceptor.open(serialPort, PowerUp.A);
        }
        catch (AcceptorException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    // enable acceptor so that it accepts bills
    public void enable()
    {
        cashAcceptor.setEnableAcceptance(true);
    }

    // disable acceptor so that it stops accepting bills
    public void disable()
    {
        cashAcceptor.setEnableAcceptance(false);
    }

    // This method gets called when any device event occurs
    public void acceptorEventOccurred(AcceptorEvent evt)
    {
        if (evt.getDescription() == null)
        {
            return;
        }
        if (evt instanceof EscrowEvent)
        {
            // Event generated for bill Escrow
            if (DocumentType.Bill.equals(cashAcceptor.getDocType()))
            {
                Bill b = cashAcceptor.getBill();
                try
                {
                    // stack the bill
                    cashAcceptor.escrowStack();
                }
                catch (AcceptorException e)
                {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
        else if (evt instanceof StackedEvent)
        {
            // Event generated when a document is stacked.
            if (DocumentType.Bill.equals(cashAcceptor.getDocType()))
            {
                Bill bill = cashAcceptor.getBill();
                String country  = bill.getCountry();
                String value = bill.getValue();
            }
        }
        else if (evt instanceof CheatedEvent)
        {
             // Event generated when the device detects a cheat attempt.
        }
        else if (evt instanceof JamDetectedEvent)
        {
            // Event generated when the device detects a jam.
        }
        else if (evt instanceof StackerFullEvent)
        {
            // Event generated when the device stacker is full.
        }
    }

}

You can view MEI CASHFLOW Bill acceptor with BNF demo here

Card Reader

August 23, 2009 Abhijeet Iraj Leave a comment

Five years back when i came to pune for a job after completing my B.E. i had no idea how to use debit card in ATM to withdraw money. One of my good friend taught me to use the card for doing transaction.

Few days back i integrated ID Tech card reader in our system at work. It’s a Really Long Way Down.

IDTech Card Reader

This is how card reader works.

When you swipe the card, card reader reads all the data from card to the system. Tracks of data on the magnetic stripe include the cardholder’s name and other personal information, credit card number and security and verification codes.

magnetic-card

Normally there are three tracks on magnetic strip on the back of the card.

Track1

This is the only track that can contain text data.Track one stores the primary account number, account holder’s name, card expiration date, service code, discretionary data (data to verify pin and security code) and the longitudinal redundancy check (LRC).

e.g.

%B4625555555555004^ABHIJEET IRAJ /^110310100524000000?

Track2

This track only allows for numbers and six other characters. This track stored the data mainly for banking industry.Track two stores primary account number, expiration date, service code, discretionary data and the LRC.

e.g.

;4633333333333304=1103104444524?

Track3

Track three is almost never used.Track1 and Track2 can only read data, Track3 allows for ‘write-back’ of information.

When you swipe the card, card reader reads the track data on magnetic stripe and is sent to the organization that actually authorizes purchases by authenticating the request. Using the data from the magnetic strip, the organization validates the request by making sure that the card has enough of the available limit to cover the purchase. It also checks to make sure that the card hasn’t been reported lost or stolen.The system comes back with an answer; either accepting or denying the request.