/** * Refund the amount * Need to decode Last 4 digits for request. * * @param Varien_Object $payment * @param decimal $amount * @return Mage_Authorizenet_Model_Directpost * @throws Mage_Core_Exception */ public function refund(Varien_Object $payment, $amount) { $last4 = $payment->getCcLast4(); $payment->setCcLast4($payment->decrypt($last4)); try { $this->_refund($payment, $amount); } catch (Exception $e) { $payment->setCcLast4($last4); throw $e; } $payment->setCcLast4($last4); return $this; }