I'm trying to write a program in Python that helps abstract payment providers away, depending on the persons' location/mobile service provider. So far I've come up with the following workflow:
1. take some HTTP POST/GET data from the end user (I think POST is best)
2. check the IP, decide which payment provider to use, perhaps looking something up in a MySQL table here
3. Formulate a HTTP GET/POST request to the chosen payment provider's server (more database lookups here)
4. Send the request, parse the response from the payment provider's system, record the whole transaction in a database
5. tell the user everything is ok
But I'm not really sure how. Python has threaded HTTP server classes - maybe I can subclass them, and customize them to do what I want them to do. That was what I was thinking. But then I read about Python WSGI and https://docs.python.org/3.4/howto/webservers.html. Is this what a web framework is supposed to simplify? If so then I can modify Django or something to suit my purposes, right? In the end there has to be a sort of CMS where one can manage all aspects of this process, but it's only an addition, the important part is the part that decides which payment provider to use. There's no need to generate many HTML pages for the end user. And how does WSGI fit into all this?