I am working on implementing a new payment module for Magento and want to understand the core concept behind this logic. I know I have to extend from Mage_Payment_Model_Method_Abstract or any of its children classes, but my problem is when to use and how to use capture and authorize methods in my model.
For example if I split the whole process in steps like this:
- User comes to the shopping cart and choses lets say some payment method which is gateway.
- The system intercepts the request, collects all submitted data and sends the user to the gateway url.
- User places his order (or cancels) at the gateway site which sends information about it to my store.
- My store does some more modifications to the order with the received data and saves the order with status completed or canceled.
Where in these steps will I have to use authorize and capture methods ? I would appreciate if someone could explain to me what authorize and capture means?