@param $transactionId

@return null
@throws \HpsException
966757
public function void($transactionId)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $void = $xml->createElement('hps:AltPaymentVoid');

        $void->appendChild($xml->createElement('hps:TransactionType', $this->_transactionType));
        $void->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $transaction->appendChild($void);
        return $this->_submitTransaction($transaction, 'AltPaymentVoid');
    }
327400
public static function checkResponse($transactionId, $responseCode, $responseText, $item)
    {
        $e = self::getException($transactionId, $responseCode, $responseText, $item);

        if ($e != null) {
            throw $e;
        }
    }
1095557
public function handleVersionTwo(Transaction $transaction): Transaction
    {
        $transaction->id = Hash::sha256($transaction->serialize())->getHex();

        return $transaction;
    }
853056
public function getTerminalUri(string $transactionId): Uri
    {
        $uri = $this->getUri('terminal', ['merchantId' => $this->merchantId, 'transactionId' => $transactionId]);

        return $uri;
    }
142573
public function execute(TransactionData $transactionData, $argument = null)
    {
        $this->logger->debug('Adding expectation');
        $transactionData->setResponse(
            $this->processAndGetResponse(
                $transactionData,
                function (TransactionData $transaction, Expectation $expectation) {
                    $this->validateExpectationOrThrowException($expectation, $this->logger);
                    $this->storage->addExpectation($expectation);

                    return $this->constructResponse([], $transaction->getResponse());
                }
            )
        );
    }
390636
public function execute(TransactionData $transactionData, $argument = null)
    {
        $this->storage->clearRequests();

        $transactionData->setResponse(
            $transactionData->getResponse()->withStatus(200)
        );
    }
225677
@Programmatic
    public List<StatusMessage> findByTransactionId(final UUID transactionId) {
        return repositoryService.allMatches(
                new QueryDefault<>(StatusMessage.class,
                        "findByTransactionId",
                        "transactionId", transactionId));
    }
786489
public function transaction(TransactionRequest $transactionRequest)
    {
      // Extract SimplePay user from request
      $user = $transactionRequest->getUser();
      $provider = $transactionRequest->getProvider();
      $payment = $transactionRequest->getPayment();

      // Create request
      $request = new StdClass();
      $request->User = new StdClass();
      $request->User->Uuid = $user->getUuid()->getValue();
      $request->User->Hash = $user->getHash();

      // Provider
      $request->Provider = new StdClass();
      $request->Provider->Uuid = $provider->getValue();

      // Payment
      $request->Payment = new StdClass();
      $request->Payment->Reference = $payment->getReference();
      $request->Payment->Amount = $payment->getAmount();
      $request->Payment->Currency = $payment->getCurrency();

      if($payment->hasDescription())
        $request->Payment->Description = $payment->getDescription();

      // Account
      if($payment->hasAccount())
      {
        $account = $payment->getAccount();

        if($account instanceof IdealAccount)
        {
          $request->Payment->Account = new StdClass();
          $request->Payment->Account->Ideal = new StdClass();
        }
        elseif($account instanceof IncassoAccount)
        {
          $request->Payment->Account = new StdClass();
          $request->Payment->Account->Incasso = new StdClass();
          $request->Payment->Account->Incasso->Holder = $account->getHolder();
          $request->Payment->Account->Incasso->Number = $account->getNumber();
          $request->Payment->Account->Incasso->City = $account->getCity();
        }
        elseif($account instanceof CreditCardAccount)
        {
          // Not implemented yet
          $request->Payment->Account = new StdClass();
          $request->Payment->Account->CreditCard = new StdClass();
        }
        elseif($account instanceof PrepaidAccount)
        {
          // Not implemented yet
          $request->Payment->Account = new StdClass();
          $request->Payment->Account->Prepaid = new StdClass();
        }
      }

      // Callback
      $callback = $transactionRequest->getCallback();

      // Old request
      $request->Options = new StdClass();
      $request->Options->Ideal = new StdClass();
      $request->Options->Ideal->SiteUrl = $callback->getRedirectUrl();
      $request->Options->Ideal->CallbackUrl = $callback->getCallbackUrl();

      // Send request
      $response = $this->getSoapClient()->transaction($request);

      // Transaction
      $transaction = new Uuid($response->Transaction->Uuid);

      // Authenticator
      $uuid = new Uuid($response->Authenticator->Uuid);
      $name = $response->Authenticator->Name;
      $authenticationUrl = $response->Authenticator->AuthenticationUrl;

      $authenticator = new Authenticator($uuid, $name, $authenticationUrl);

      $transactionResponse = new TransactionResponse($transaction, $authenticator);

      return $transactionResponse;
    }
1319547
public function delete($paymentId)
    {
        $db = $this->getDb();
        $db->startTransaction();

        $deleteResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));
        $deleteCommentResult = $db->execute('DELETE FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));

        $result = ($deleteResult !== false) || ($deleteCommentResult !== false);

        if ($result) {
            $db->commitTransaction();
        } else {
            $db->rollbackTransaction();
        }

        return $result;
    }
161597
public static function get_last_by_transaction(Transaction $transaction) {
		$db = Database::Get();
		$id = $db->get_one('SELECT id FROM transaction_log WHERE transaction_id=? ORDER BY created DESC LIMIT 1', [ $transaction->id ]);
		if ($id === null) {
			throw new \Exception('No transaction_log yet');
		}

		return self::get_by_id($id);;
	}
1092411
public function post(
        ResponseInterface $response,
        string $transactionId,
        array $options = []
    ): CancellablePromiseInterface {
        if ($response->getBody() instanceof ReadableStreamInterface) {
            return resolve($response);
        }

        if (!isset($options[self::class]) &&
        strpos($response->getHeaderLine('Content-Type'), 'text/xml') !== 0) {
            return resolve($response);
        }

        if (isset($options[self::class][Options::CONTENT_TYPE]) &&
        $response->getHeaderLine('Content-Type') !== $options[self::class][Options::CONTENT_TYPE]) {
            return resolve($response);
        }

        $body = (string)$response->getBody();
        if ($body === '') {
            $stream = new BufferStream(0);
            $stream->write($body);

            return resolve($response->withBody($stream));
        }

        return $this->xmlDecodeService->decode($body)->then(function (array $xml) use ($response) {
            return resolve($response->withBody(new XmlStream($xml)));
        });
    }
751711
public RefundQueryResponse queryByTransactionId(String transactionId){
        Map<String, String> queryParams = buildQueryParams(WepayField.TRANSACTION_ID, transactionId);
        Map<String, Object> respData = doPost(QUERY, queryParams);
        return renderQueryResp(respData);
    }
1054379
private static function persistTransactionPart($transactionPart, $transaction_id) {
        $transactionPart->transaction_id = $transaction_id;

        TransactionPersistance::setAccountBalance($transactionPart->account_id, $transactionPart->accountSide, $transactionPart->value);

        if (!$transactionPart->save(false)) {
            throw new Exception("TransactionPart could not be saved. Data: " . print_r($transactionPart->attributes,true));
        }
    }
397783
protected function loadOrderPayment($transactionId)
    {
        $orderPayment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
        $orderPayment->loadByTransactionId($transactionId);

        return $orderPayment;
    }
742764
public function get($orderId, $transactionId, array $params = array())
    {
        $endpoint = '/admin/orders/'.$orderId.'/transactions/'.$transactionId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Transaction::class, $response['transaction']);
    }
564196
public static function get($transactionId)
    {
        $api = new Api\Info();
        $api->setTransactionId($transactionId);
        $result = $api->doRequest();

        $result['transactionId'] = $transactionId;

        return new Result\Transaction($result);
    }
108786
protected function getCommand(Transaction $transaction)
    {
        switch ($transaction->getType()->getValue()) {
            case Transaction\TransactionType::SALE:
                return 'ECheck.ProcessPayment';

            case Transaction\TransactionType::AUTH:
                return 'ECheck.Authorize';

            case Transaction\TransactionType::CAPTURE:
                return 'ECheck.Capture';

            case Transaction\TransactionType::REFUND:
                return 'ECheck.Refund';

            case Transaction\TransactionType::VOID:
                return 'ECheck.Void';

            case Transaction\TransactionType::QUERY:
                return 'ECheckReports.StatusTrackingQuery';

            case Transaction\TransactionType::UPDATE:
                return 'ECheck.Update';
        }
    }