O$ interface with Credit Card machine

Phil (OmnisList) phil at pgpotter.co.uk
Mon Nov 12 04:30:16 EST 2018

Something like this maybe:

Do llCGIlist.$define()
Do llCGIlist.$cols.$add('attribute',kCharacter,kSimplechar,30)
Do llCGIlist.$cols.$add('value',kCharacter,kSimplechar,30)

...Add values to list..

HTTPGet (ccWebserver,con(ccWebPath,ccLatestVersion),llCGIlist) Returns 
If lnSocket<0
     Do code method ccError/ErrorHandler (lnSocket)
     Quit method
End If
HTTPRead (lnSocket,lcResult) Returns lnCounter
HTTPClose (lnSocket)

Phil Potter
Based in Chester in the UK.

On 10/11/2018 00:54, Michael Houlberg wrote:
> 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 “”. [02] as STX, [03] as ETX, [1c] as field separator.
> Initialize (A00) (A01)
> Message before base64 encoded:[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 "“ into Omnis HTTPGet?
> Thanks,
> Michael Houlberg
> Houlberg Development, LLC
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

More information about the omnisdev-en mailing list