1

I'm using Magento 1.9.1.0 CE and trying to implement payment method with online refunds.

My model looks like:

class X_Y_Model_Standard extends Mage_Payment_Model_Method_Abstract {

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

        ...

        public function refund(Varien_Object $payment, $amount) {   

            ...
            return parent::refund($payment, $amount);
        }

        ...

        public function capture(\Varien_Object $payment, $amount) {

            $payment->setTransactionId($myApiTransactionId);        
            $transaction = $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH, null, true, "");
            $transaction->setIsClosed(true);       

            return parent::capture($payment, $amount);
        }   

        ...

        public function processInvoice($invoice, $payment) {

            $invoice->setTransactionId($myApiTransactionId);

            return parent::processInvoice($invoice, $payment);
        }

        ...
    }

After creating invoice I can only refund offline.

Any idea?

2

You can only do refunds online if you've captured the invoice online (e.g via a payment gateway). Since this is not the case you only can do offline refunds.

  • Michael thanks for the fast response, seems like that isn't my problem. I have $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE); in my createInvoice method but no online refund. – WWSasa Apr 3 '15 at 13:46
  • I guess you don't get the option due to $this->getCreditmemo()->getInvoice()->getTransactionId() in Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items around line 56. It seems that the transaction id is not saved to the invoice or the processInvoice method is not called. – luemic Apr 3 '15 at 15:14
  • I managed to solve issue from that point, thank you Michael. – WWSasa Apr 6 '15 at 10:18
0

I'm using Magento CE 1.9.1 and have attempted online refunds for ePN. I get a gateway error due to a response code for CVV2 being (P) meaning not processed. I spoke with ePN support about it and they stated the only way to get this done is to pass the CVV2 code back for refund, however its against PCI to capture CVV2 codes. What I did to get the refund transaction to go through was to check the box P - Not Processed within the ePN config console. This allowed the refund to go through, however PLEASE NOTE the refund showed up as a sale within ePN! NOT a refund.

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.