Question

I would like to know the flow of calls to various methods in payment method of magento. Like when do authorize(), capture(), refund() etc. gets called? And what could be the possible scenario which may influence it (if any)?

Was it helpful?

Solution

Almost all payment methods provide functionality to block and then to get the money from customer. Also you can return money back.

Usually workflow is like this:

  • Creating order - authorize() - money are blocked on customers account but still are there.
  • Creating invoice - capture() - block money are transferred from customers to your account
  • Creating credit memo - refund() - amount is returned to customers account.

Some payment methods you can configure to process authorize() and capture() during creating order at the same time.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top