24
I'd better expand on my idea so you can better understand my reasoning.
Let's take the downloads module as an example.
Today when you select download, you are sent the file. My idea is to instead send a request to the gateway module with information about the product (download title), price etc. in a standardised format, dictated by the gateway module. Then the gateway module would show this information and take care of payment. After correct payment details, the user is sent to a page in the downloads module (specified by the downloads module in the request) where the download would be initiated.
The gateway module does not have to know what it is the customer is buying, only some standardised information about the product/service and a location to send the user to after successful payment (and one for unsuccessful and one for if the user cancels the process). The information in the request would also be the basis for the invoice, which I agree should be handled by the gateway module.
That way, the downloads module content will BE the product catalogue and there is no need to have this in the gateway module as well.
A subscription module would be in-between the downloads module and the gateway module so that the downloads module sends the request to the subscription module, which checks the user's subscription status and if not valid, sends the user on to the gateway module, where payment will happen, then going back to the subscription module that updates the user's subscription status and sends the user on to the downloads module for actually downloading the file.
Any immediate errors in this thinking? Keep in mind that we are still at a very early stage and it will take some more thinking, analysis and design before settling on a solution.