I have a web app hosted on a public hosting platform. I also have a card payment terminal that is connected to my local network. I'd like for the user to click on "Pay with card" and the web app would reach out to the terminal on the client's local network and send the necessary packets.
I dug around a bit, found this SO thread, tried to go the WCF route suggested in the thread, following this tutorial, and possibly calling the WCF endpoint using Javascript's XMLHttpRequest. Is there a better way to do this? Can I somehow realiably test the WCF service in Windows? My experience with C# so far was developing a couple of really simple Console apps a couple of years back, so when it comes to Windows Services and such, I'm completely lost. Any pointers are appreciated!
WCF is an option (although it has a steep learning curve). Once you understand the concept of endpoints, contracts, clients, bindings, and service hosting in WCF you can do a lot of work with a few lines of code. This is the simplest example I could find regarding a working WCF service. If you wanna do it "the old way" you can use socket api. See an example in socket class. It is more straightforward, but you have to implement the communication protocol from scratch.
Also, you can use a WebSocket connection from the website in case the connection needs to be open for longer period of time.