Hi, I’ve been studying the different reading materials scattered across the net and the Magento Wiki such as the “creating custom payment module”, but I could not come across a definitive, comprehensive understanding and guide. Having read so many mixed stuffs is both clarifying and confusing me, esp. with regards to the XML contents (although i do know they define the basic configurations...I am still having an extremely difficult time constructing them).
I need to create two modules: one for sending variable information to the gateway URL, which at the same time redirects the customer to the gateway page and two, for getting credit card information from the checkout onepage and sending these information to the gateway URL.
Here are my issues:
1.) What is the actual flow of everything? That is the MVC for Magento…
2.) How does this correlate to the front end?
3.) Where is the detailed explanation of what each tag in the custom.xml and system.xml is used for? Examples?
4.) What are the extended classes/objects and methods that are useful for creating a payment module?
5.) How can I let the checkout “onepage” see my payment module and my module’s block or templates or whatever is needed? I need to figure out the “missing link” between the onepage “payment information” so that my payment module form could show up?
My perception (dunno if im right or wrong):
For Questions 1 and 2 and 3:
Let me start with VIEW:
a.) The template contains phtml files which show php and xhtml tags/information. These display information to the user. (I still dont understand where structural templates show in the pthml file - does it even show anything? or it just provides the basic area where to show the html codes?)
b.) The block points or calls the templates. Contains the structural block and content (What methods should, in imperative, be extended and shown here?)
c.) The layout arranges the blocks in order. (What should i do to make my payment module appear in the checkout onepage?)
Next is the MODEL:
I know that data objects (business data objects) are usually in the model, as well as getting and setting information from the database.
What objects should I extend aside from, of course, the Mage_Payment_Model_? What are the important methods/constants which I must absolutely use? What are the usual methods/constants which I may possibly use? (There are so many methods, some of which I do not understand very well of what use they may be because there are no descriptions and comments, while some have vaguely understandable comments - just an objective comment IMHO).
Then the CONTROLLER:
What is the difference between the Controller and the controllers folder content? Is it that the indexController is in the controllers folder and acts as a router to the layout??? or block? or templates? (how is this different with the Struts Action of Java?)
There are other methods which are not declared and defined such as the getChildHtml, setTemplate, etc.? Is it me or are they really not declared and defined?
I want to create and show a text field in my payment module form from the admin end, asking the user to type their merchant ID, which I want to send to the gateway. I believe there is no such method or html available to ask such information. What do I do to be able to add my custom created field and call the information from the [controller or model???] so that I may send the merchant ID?
I would extremely appreciate any detailed response I could get from the team members of Magento and/or the community of seasoned veterans because I am competing with time in developing a payment module for my project.
Thank you very much!