CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
64 stars 44 forks source link

Adding Pax Sign & Pay support #755

Closed thefinn93 closed 8 years ago

thefinn93 commented 8 years ago

I've been asked to add support for a couple of Pax's card terminals. I will of course be posting my code online and making one or more pull requests back to you when it's done. However, I'm not sure what the best way to go about this is. Ideally (I would think) it would be implemented as a plugin, but it doesn't look like that's really possible, or at least hasn't been done before. Additionally, the UI appears to expect the terminal to be connected to the POS machine via a serial or USB cable. The Pax terminals are connected via Ethernet and communicated with over some horribly designed protocol.

Anyway, I'm just looking for some guidance for where I should be looking in the code base. I'm going to continue poking around it and hopefully I'll be able to work it out on my own, but I'm also interested in any other input.

gohanman commented 8 years ago

All the PHP code related to existing integrated payment mechanisms is in the Paycards plugin. In all current instances the UI does not know how the terminal is connected to the POS. It just talks to the C# driver NewMagellan. This is because either a) a web-based application is poorly suited to receiving device-initiated messages or b) an ActiveX control is needed.

A lot depends on how the Pax device communicates. If the device can send data unprompted then you probably need a C# module mediating. PHP isn't running between page loads so it can't be listening at all times for randomly timed data from the device. If it's strictly request+response where the device only sends data in response to a request you should be able to do the whole thing in PHP (or PHP+Javascript).

I'd definitely suggest writing information about the transactions to the PaycardTransactions table. That'll recycle some receipt footers and back end reporting. I'm less convinced that it makes sense to shoehorn things into the existing Paycards plugin rather than writing a new one. There's some ugly code in there and there may not be enough cleanly reusable stuff to meaningfully save time.

thefinn93 commented 8 years ago

Alright, cool. The Pax device doesn't send anything unprompted as best I can tell, so I'm hoping to do it all in PHP.