RhoElements CardReader Problems

For one of our applications we are using the Motorola ET1 and the new ET1 Scan/MSR Module(MSRSCAN) with RhoElements  To access the MSR interface we then use the RhoElements Card Reader interface to scan the mag-stripe.

From the example, this should be a simple matter of configuring the event with a META tag or JavaScript and then processing the returned object.  But alas it is not that simple.

Incorrect Example Code

First, the JavaScript Example code that is provided  uses a META tag to specify the event handler and a sample event handler.  Unfortunately this does NOT work because it is not in the proper format which must either be a URI or JavaScript object.

So instead of using string parameters for the event like this:

<!-- BAD -->
<META HTTP-Equiv="CardReader" Content="ReadEvent:url('javascript:doTransaction('%s', '%s');')">
<script language="javascript" type="text/javascript">
    function doTransaction(data, mode)

You need to specify it as a JavaScript like this:

<META HTTP-Equiv="CardReader" Content="ReadEvent:url('javascript:doTransaction(%json);')">    
<script language="javascript" type="text/javascript">
     function doTransaction(jsonObject) {

Invalid Object Returned

I actually had another problem that I posted to the Motorola Launchpad Site (CardReader Event Problems) that is now fixed thanks to Darryn Campbell.

What I was doing was putting single quotes around the event argument, ‘%json’ instead of just %json itself.  This causes the event processor to escape the returned data, which is obviously not what we needed.


Leave a Reply

Your email address will not be published. Required fields are marked *