/**
  * Tests Services_Paymill_Transaction->update()
  */
 public function testUpdate()
 {
     try {
         $this->_transaction->update();
     } catch (Exception $e) {
         $this->assertInstanceOf('Services_Paymill_Exception', $e);
         $this->assertEquals(404, $e->getCode());
     }
 }
 private function _success()
 {
     global $db;
     $preauthId = null;
     $transactionId = null;
     if (array_key_exists('paymillTransactionId', $_SESSION)) {
         $transactionId = $_SESSION['paymillTransactionId'];
         unset($_SESSION['paymillTransactionId']);
     } elseif (array_key_exists('paymillPreauthId', $_SESSION)) {
         $preauthId = $_SESSION['paymillPreauthId'];
         unset($_SESSION['paymillPreauthId']);
     }
     if (!is_null($transactionId)) {
         $this->_transactions->update(array('id' => $_SESSION['paymillTransactionId'], 'description' => ' OrderID: ' . $_SESSION['success_order_id'] . ' ' . _STORE_NAME));
     }
     if (!is_null($transactionId) || !is_null($preauthId)) {
         $db->Execute('INSERT INTO `pi_paymill_transaction` ' . '(`order_id`, `transaction_id`, `preauth_id`) ' . 'VALUES(' . '"' . $_SESSION['success_order_id'] . '", ' . '"' . $transactionId . '", ' . '"' . $preauthId . '"' . ')');
     }
 }
 /**
  * Updates the description of target transaction by adding the prefix 'OrderID: ' followed by the order id
  * @param String $id
  * @param String $orderId
  */
 function updateTransaction($id, $orderId)
 {
     $this->log('Updating transaction description', '');
     require_once DIR_FS_CATALOG . 'ext/modules/payment/paymill/lib/Services/Paymill/Transactions.php';
     $transactions = new Services_Paymill_Transactions($this->privateKey, $this->apiUrl);
     $transaction = $transactions->getOne($id);
     $description = substr('OrderID: ' . $orderId . ' ' . $transaction['description'], 0, 128);
     $transactions->update(array('id' => $id, 'description' => $description));
 }
 private function updatePaymillTransaction($transactionID, $description)
 {
     $transactionObject = new Services_Paymill_Transactions(Configuration::get('PIGMBH_PAYMILL_PRIVATEKEY'), "https://api.paymill.com/v2/");
     $transactionObject->update(array('id' => $transactionID, 'description' => $description));
 }
 /**
  * This method updates the description of the current transaction by adding the order number
  * @param $orderNumber
  * @param $paymentProcessor
  * @param $loggingManager
  */
 private function _updateTransaction($orderNumber, $paymentProcessor)
 {
     //Update Transaction
     require_once dirname(__FILE__) . '/../../lib/Services/Paymill/Transactions.php';
     $user = Shopware()->Session()->sOrderVariables['sUserData'];
     $swConfig = Shopware()->Plugins()->Frontend()->PaymPaymentCreditcard()->Config();
     $privateKey = trim($swConfig->get("privateKey"));
     $apiUrl = "https://api.paymill.com/v2/";
     $transaction = new Services_Paymill_Transactions($privateKey, $apiUrl);
     $description = $orderNumber . " " . $user['additional']['user']['email'] . " " . Shopware()->Config()->get('shopname');
     $description = substr($description, 0, 128);
     $updateResponse = $transaction->update(array('id' => $paymentProcessor->getTransactionId(), 'description' => $description));
     if ($updateResponse['response_code'] === 20000) {
         $this->logging->log("Successfully updated the description of " . $paymentProcessor->getTransactionId(), $description);
     } else {
         $this->logging->log("There was an error updating the description of " . $paymentProcessor->getTransactionId(), $description);
     }
 }
 /**
  * Updates the description of target transaction by adding the prefix 'OrderID: ' followed by the order id
  * @param String $id
  * @param String $orderId
  */
 function updateTransaction($id, $orderId)
 {
     $transactions = new Services_Paymill_Transactions($this->privateKey, $this->apiUrl);
     $transaction = $transactions->getOne($id);
     $description = substr('OrderID: ' . $orderId . ' ' . $transaction['description'], 0, 128);
     $transactions->update(array('id' => $id, 'description' => $description));
 }