Problem/Motivation
This is probably a pity that I upload it for 7.x version but my client is still on D7 unfortunately.
So the problem, as discussed in private chats and other blogs, is the testing service. Whenever a client wants to interact with AlphaBank, they need to contact the bank and get demo credentials for a demo instance with demo data that will allow them to run tests.
However, when the client requires CI testing, this becomes too hard as the testing service of the bank is not available forever. Furthermore, the vast majority of times does not care about what happens in the bank side. They want to test what happens after the user returns.
Proposed resolution
I am proposing in the attached patch a small module that I placed in the tests
directory. The idea of the module is that it offers a very simple form. The form has 3 buttons, 'Success', 'Failure', and 'Cancel'. No input of card details (at least I didn't need such a thing yet) or amount of payment and extra data. The details on the form of AlphaBank is pretty simple anyway.
The user can click on the buttons and random strings are generated for transaction ids and payment reference.
I do not know of the algorithm used to generate these data and I also don't think that it matters for the testing implementation.
The user can then simply receive the data back to the results page and let the rest be handled by commerce and alpha redirect module.
This is only meant for testing since (it resides in the tests folder after all) and further improvements can be performed.
It, however, offers the ability for a website to have a CI bot testing the whole functionality on the website regardless of the API of the bank.
A readme file is included for a quick start.