/**
     * @param Pap_Common_Transaction $transaction
     * @param $transactionHeader
     * @param $transactionData
     * @param $matchTransactionField
     * @return Pap_Common_Transaction
     */
    private function loadTransaction(Pap_Common_Transaction $transaction, $transactionHeader, $transactionData, $matchTransactionField) {
        Gpf_Log::info('Matching transaction by: ' . $matchTransactionField);
        $data = array_flip($transactionHeader);
        $orderId = $transactionData[$data[$matchTransactionField]];

        if(trim($orderId)!=''){
            $transaction->set($matchTransactionField, $orderId);
            try{
                $transaction->loadFromData(array($matchTransactionField));
            } catch (Gpf_DbEngine_NoRowException $e) {
                Gpf_Log::info('No transaction with '.$matchTransactionField.': '.$orderId.' found.');
            } catch (Gpf_DbEngine_TooManyRowsException $e) {
                Gpf_Log::info('Too many transactions with '.$matchTransactionField.': '.$orderId);
                throw new Gpf_Exception($this->_('Too many transactions with '.$matchTransactionField.': '.$orderId));
            }
        }
        return $transaction;
    }
 /**
  * @return Pap_Common_Transaction
  */
 protected function findTransaction($subscriptionId, $type = Pap_Common_Constants::TYPE_SALE) {
     $transaction = new Pap_Common_Transaction();
     $transaction->setOrderId($subscriptionId);
     $transaction->setType($type);
     $transaction->setTier(1);
     $transaction->loadFromData(array(Pap_Db_Table_Transactions::ORDER_ID, Pap_Db_Table_Transactions::TIER, Pap_Db_Table_Transactions::R_TYPE));
     return $transaction;
 }