O$ interface with Credit Card machine

Michael Houlberg michael at houlbergdevelopment.com
Fri Nov 9 19:54:16 EST 2018


I’m trying to communicate with a credit card machine.  This one is made by PAX, but my problem isn’t necessarily bound to any particular manufacturer.  My problem is how to correctly use the HTTPGet command in Omnis.

The way you talk to this machine is via HTTP using GET on the local area network.  The manual makes it look easy enough.  For instance to initialize the device they show this example:

Assume the destination of Terminal “IP: Port” is “192.168.2.100:10009”. [02] as STX, [03] as ETX, [1c] as field separator.
3.3.2.1. Initialize (A00) (A01)
http://192.168.2.100:10009?AkEwMBwxLjI4A0s=
Message before base64 encoded: http://192.168.2.100:10009?[02]A00[1c]1.28[03]K

What’s going on here, is the actual content you are sending are the strings “A00” and “1.28”.  It uses control characters shown in HEX to mark the start (02), a field separators (1c), and the end (03).  The ‘K’ on the end is a check character, and I’ve figured out how to generate that.  I have the part working where I use the Omnis functions bintobase64() and utf8tochar() to translate the message to base 64 including the check character then turn it into the string “AkEwMBwxLjI4A0s=“ as shown in the example, so I think that part is right.

If I type the above http string into a browser, it returns a good response.  But how do I format that for the Omnis HTTPGet?

HTTPGet (host,uri[,cgilist,hdrlist,service|port,secure {Default kFalse},verify {Default kTrue},map+ {Default kFalse}]) Returns socket

HTTPGet wants a uri, but there really isn’t one here.  And then it wants to send any parameters as part of a cgilist.  How do I translate "http://192.168.2.100:10009?AkEwMBwxLjI4A0s=“ into Omnis HTTPGet?

Thanks,
Michael Houlberg
Houlberg Development, LLC


More information about the omnisdev-en mailing list