2

I have a custom payment plugin that so far has only authorize functionality. This means that in my model I have only:

protected $_canAuthorize = true;
protected $_canCapture = false;
protected $_canRefund = false;
protected $_canVoid = false;

I can close the payment, but when I create the invoice I don't see any option for refund, void, capture. Is this related to the fact that all the others flags are set to false and that the functions are not implemented?

1
  • I don't know much about payment, but I think the others can help if you post at least the other flags, better the whole class. Sep 11, 2013 at 10:54

1 Answer 1

1

It seams straight forward to me. If the payment methods does not allow caprure, refund and void it seams normal not to have the options in the invoices.
But just to make sure, if you drill down in the code starting from Mage_Sales_Model_Order_Invoice::canVoid() you will find this line:

$canVoid = $this->getOrder()->getPayment()->canVoid($this);

that will get you to Mage_Sales_Model_Order_Payment::canVoid(Varien_Object $document) where you will find this line:

$this->_canVoidLookup = (bool)$this->getMethodInstance()->canVoid($document);

Going deeper you end up in Mage_Payment_Model_Method_Abstract::canVoid() that simply returns $this->_canVoid.
I didn't check, but I have a feeling that it's the same for capture and refund.

1
  • I'm also having the same problem. I'm working on eBizCharge payment gateway and unable to see the void button. class Mage_Ebizcharge_Model_CCPaymentAction extends Mage_Payment_Model_Method_Cc is my class declaration and I'd set the values $_canCapture = true; $_canRefund = true; $_canVoid = true;. Mar 4, 2014 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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