Get all the information for a transaction, supported by mPAY24

@param int    $mpay24tid The mPAY24 transaction ID
@param string $tid       The transaction ID from your shop

@return TransactionStatusResponse
357772
public function transactionStatus($mpay24tid = null, $tid = null)
    {
        $request = new TransactionStatus($this->config->getMerchantId());

        $request->setMpayTid($mpay24tid);
        $request->setTid($tid);

        $this->request = $request->getXml();

        $this->send();

        $result = new TransactionStatusResponse($this->response);

        return $result;
    }
1321031
public function actionPost($cid = null, $fid = null, $tid = null, $pid = null)
    {
        $thread = Thread::find()->where([
                'id' => $tid,
                'category_id' => $cid,
                'forum_id' => $fid
            ])->limit(1)->one();
        if (empty($thread)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if ($thread->locked == 1 && !User::can(Rbac::PERM_UPDATE_THREAD, ['item' => $thread])) {
            $this->info(Yii::t('podium/flash', 'This thread is locked.'));
            return $this->redirect([
                'forum/thread',
                'cid' => $thread->forum->category->id,
                'fid' => $thread->forum->id,
                'id' => $thread->id,
                'slug' => $thread->slug
            ]);
        }

        if (!User::can(Rbac::PERM_CREATE_POST)) {
            $this->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
            return $this->redirect(['forum/index']);
        }

        $model = new Post();
        $model->subscribe = 1;
        $postData = Yii::$app->request->post();
        $replyFor = null;
        if (is_numeric($pid) && $pid > 0) {
            $replyFor = Post::find()->where(['id' => $pid])->limit(1)->one();
            if ($replyFor) {
                $model->content = Helper::prepareQuote($replyFor, Yii::$app->request->post('quote'));
            }
        }

        $preview = false;
        $previous = Post::find()->where(['thread_id' => $thread->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();
        if ($model->load($postData)) {
            $model->thread_id = $thread->id;
            $model->forum_id = $thread->forum->id;
            $model->author_id = User::loggedId();
            if ($model->validate()) {
                if (isset($postData['preview-button'])) {
                    $preview = true;
                } else {
                    if ($model->podiumNew($previous)) {
                        $this->success(Yii::t('podium/flash', 'New reply has been added.'));
                        if (!empty($previous) && $previous->author_id == User::loggedId() && $this->module->podiumConfig->get('merge_posts')) {
                            return $this->redirect(['forum/show', 'id' => $previous->id]);
                        }
                        return $this->redirect(['forum/show', 'id' => $model->id]);
                    }
                    $this->error(Yii::t('podium/flash', 'Sorry! There was an error while adding the reply. Contact administrator about this problem.'));
                }
            }
        }
        return $this->render('post', [
            'replyFor' => $replyFor,
            'preview' => $preview,
            'model' => $model,
            'thread' => $thread,
            'previous' => $previous,
        ]);
    }
1196459
public static function getByID($btsID)
    {
        $result = null;
        $btsID = (int) $btsID;
        if ($btsID !== 0) {
            $app = Application::getFacadeApplication();
            $cache = $app->make('cache/request');
            $identifier = sprintf('block/type/set/%s', $btsID);
            $item = $cache->getItem($identifier);
            if ($item->isMiss()) {
                $item->lock();
                $db = $app->make(Connection::class);
                $row = $db->fetchAssoc('select btsID, btsHandle, pkgID, btsName from BlockTypeSets where btsID = ?', [$btsID]);
                if ($row !== false) {
                    $result = new static();
                    $result->setPropertiesFromArray($row);
                }
                $item->set($result)->save();
            } else {
                $result = $item->get();
            }
        }

        return $result;
    }
1072896
public static function getPrice($tid) {
    $build = [];

    $form = new \Drupal\site_commerce\Form\SiteCommerceGetPriceForm($tid);

    $form = \Drupal::formBuilder()->getForm($form, $tid);

    $build['price_list'] = array(
      '#theme' => 'site_commerce_get_price',
      '#tid' => (int) $tid,
      '#form' => $form,
    );

    return $build;
  }
402743
public function cancel($mpayTid)
    {
        $this->integrityCheck();

        $cancelTransactionResult = $this->mpay24Sdk->manualReverse($mpayTid);

        $this->recordedLastMessageExchange('CancelTransaction');

        return $cancelTransactionResult;
    }
618372
public function refund($transactionId, $isPartial = false, $partialAmount = null)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $return = $xml->createElement('hps:AltPaymentReturn');

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

        if ($isPartial) {
            $return->appendChild($xml->createElement('hps:Amt', $partialAmount));
        }

        $payment = $xml->createElement('hps:Return');
        $nvp = $xml->createElement('hps:NameValuePair');
        $nvp->appendChild($xml->createElement('hps:Name', 'ReturnType'));
        $nvp->appendChild($xml->createElement('hps:Value', $isPartial ? 'partial' : 'full'));
        $payment->appendChild($nvp);

        $return->appendChild($payment);
        $transaction->appendChild($return);
        return $this->_submitTransaction($transaction, 'AltPaymentReturn');
    }
625587
public function manualClear($mpayTid, $amount)
    {
        $request = new ManualClear($this->config->getMerchantId());

        $request->setMpayTid($mpayTid);
        $request->setAmount($amount);

        $this->request = $request->getXml();

        $this->send();

        $result = new ManualClearResponse($this->response);

        return $result;
    }
1303310
public function fetchTransactionInfo(InfoInterface $payment, $transactionId)
    {
        try {

            $transaction = $this->transactionRepository->getByTransactionId(
                $transactionId,
                $payment->getId(),
                $payment->getOrder()->getId()
            );

            $transactionDetails = $transaction->getAdditionalInformation(Transaction::RAW_DETAILS);
            $transactionReference = $transactionDetails['Reference'];

            if (!empty($transactionReference)) {
                $order = $payment->getOrder();
                $this->orderHelper->updateOrderPayment($order, null, $transactionReference);
            }

        } catch (\Exception $e) {
            $this->bugsnag->notifyException($e);
        } finally {
            return [];
        }
    }
881997
function igets($fid=0,$order = 'id')
	{
		$gets['fid'] = $fid;
		$gets['order'] = $order;
		return $this->gets($gets);
	}
187130
def get_by_id(self, tx_id: str) -> ScheduledTransaction:
        
        return self.query.filter(ScheduledTransaction.guid == tx_id).first()
270238
public function refund($mpayTid, $amount)
    {
        $this->integrityCheck();

        $this->validateAmount($amount);

        $creditAmountResult = $this->mpay24Sdk->manualCredit($mpayTid, $amount);

        $this->recordedLastMessageExchange('RefundAmount');

        return $creditAmountResult;
    }
1015905
public function getTransaction(string $txid): GetTransactionResponse
    {
        $command = new GetTransactionCommand($txid);
        $response = $this->driver->executeCommand($command);

        return new GetTransactionResponse($response->getRawData());
    }
1088721
public function loadProducts($tid, $status = 1) {
    $loadProducts = &drupal_static(__FUNCTION__);
    if (!isset($loadProducts)) {
      $query = $this->connection->select('site_commerce_field_data', 'n');
      $query->fields('n', array('pid', 'title'));
      if ($status < 2) {
        $query->condition('n.status', $status);
      }
      $query->innerJoin('site_commerce__field_category', 't', 't.entity_id=n.pid');
      $query->condition('t.field_category_target_id', $tid);

      $loadProducts = $query->execute()->fetchAllKeyed();
    }
    return $loadProducts;
  }
1311885
public function getPaymentRefunds($paymentID)
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->PaymentID = $paymentID;
        // -----------------------------------------  
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for getPaymentRefunds and get response
        $result = $this->client->getPaymentRefunds($obj);

        $result = $result->GetPaymentRefundsResult;
        $refunds = isset($result->Refunds->Refund) ? $result->Refunds->Refund : null;

        $obj->Timestamp = $result->Timestamp;

        if (!is_null($refunds)) {
            // Assign all properties of the DayStatistics object as property of mainObject
            $obj = $this->parseForChecksum($obj, $refunds, true, array("RefundID", "DateCreated", "RefundAmount", "RefundCurrency", "Status"));
        }

        // Unset properties for new Checksum
        unset($obj->Checksum);

        // Verify response data by making a new Checksum
        $Checksum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $Checksum)
            throw new Exception('Data could not be verified');

        return (!is_null($refunds)) ? $this->forceArray($refunds) : array();
    }
1271312
public function void($transactionId)
    {
        $txnType = 'GiftCardVoid';

        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsGiftCard = $xml->createElement('hps:'. $txnType);
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $hpsGiftCard->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsGiftCard);

        return $this->_submitTransaction($hpsTransaction, $txnType);
    }
1341863
public function getRawMessage($cb, $uid, $byUid = true)
    {
        $this->onResponse->push($cb);
        $this->fetch(['FLAGS', 'BODY[]'], $uid, null, $byUid, self::TAG_GETRAWMESSAGE);
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }