/**
  * execute if transaction was refunded
  * 
  * @param SofortLib_TransactionData $transData
  * @param Mage_Sales_Model_Order $order
  * @return void
  */
 private function _transactionRefunded($transData, $order)
 {
     $payment = $order->getPayment();
     if (!$payment->getTransaction($transData->getTransaction() . '-refund')) {
         $payment->setParentTransactionId($transData->getTransaction())->setShouldCloseParentTransaction(true)->setIsTransactionClosed(0)->registerRefundNotification($transData->getAmountRefunded());
         // lastschrift by sofort
         if ($transData->isLastschrift()) {
             $refundStatus = Mage::getStoreConfig('payment/sofort/lastschriftsofort_order_status_refund');
             // Rechnung
         } else {
             $refundStatus = Mage::getStoreConfig('payment/sofort/sofortrechnung_order_status_refund');
         }
         if ($refundStatus == 'unchanged') {
             $order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('The invoice has been canceled.'))->setIsVisibleOnFront(true);
         } else {
             $order->addStatusHistoryComment(Mage::helper('pnsofortueberweisung')->__('The invoice has been canceled.'), $refundStatus)->setIsVisibleOnFront(true);
         }
         $order->save();
     }
 }