1

I'm trying to understand payment flow.

I have idea on following topics:

Auth only:Its only check authorization of transaction.

Auth & Capture: Its check authorization of transaction also capture the amount.

In both classes same type of methods are there.For example capture() method.

So finally which class is responsible of capture?

can anyone give idea on this?

2

I found following article .its giving some overall idea.

http://www.slideshare.net/gxjansen/vinai-kopp-field-renderers-payment-flow

When saving order its calling place() call back method in Mage_Sales_Model_Service_Quote (this class deals with convert quote object to order object).

$transaction->addCommitCallback(array($order, 'place'));

in turn its call placepayment method.

protected function _placePayment()
    {
        $this->getPayment()->place();
        return $this;
    }

So finally it will reach to place method of Mage_Sales_Model_Order_Payment

here based on payment action authorize , capture etc functions will call.then payment method level authorize or capture functions will call.

switch ($action) {
                    case Mage_Payment_Model_Method_Abstract::ACTION_ORDER:
                        $this->_order($order->getBaseTotalDue());
                        break;
                    case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
                        $this->_authorize(true, $order->getBaseTotalDue()); // base amount will be set inside
                        $this->setAmountAuthorized($order->getTotalDue());
                        break;
                    case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE:
                        $this->setAmountAuthorized($order->getTotalDue());
                        $this->setBaseAmountAuthorized($order->getBaseTotalDue());
                        $this->capture(null);
                        break;
                    default:
                        break;

}

|improve this answer|||||
  • Please don't post single link answers. Explain in a few words what you found on that page. – Marius Dec 11 '14 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.