Selects and loads order payment history.

@param string $paymentId Order id.
2540
public function load($paymentId)
    {
        $this->setPaymentId($paymentId);

        $comments = array();
        $commentsData = $this->getDbGateway()->getList($this->getPaymentId());
        if (is_array($commentsData) && count($commentsData)) {
            $comments = array();
            foreach ($commentsData as $data) {
                $comment = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentComment::class);
                $comment->setData($data);
                $comments[] = $comment;
            }
        }

        $this->setArray($comments);
    }
990987
public function validatePayment($orderId)
    {
        /**
         * Loads order to validate.
         */
        $this
            ->paymentBridge
            ->findOrder($orderId);

        /**
         * Order Not found Exception must be thrown just here.
         */
        if (!$this->paymentBridge->getOrder()) {
            throw new PaymentOrderNotFoundException();
        }

        /**
         * Payment paid successfully.
         *
         * Paid process has ended successfully
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderSuccess(
                $this->paymentBridge,
                $this
                    ->methodFactory
                    ->create()
            );

        return $this;
    }
614430
public function getList($paymentId)
    {
        $db = $this->getDb();
        $data = $db->getAll('SELECT * FROM `oepaypal_orderpaymentcomments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId) . ' ORDER BY `oepaypal_date` DESC');

        return $data;
    }
1199447
public function execute($paymentId)
    {
        $url    = $this->environment->getApiUrl() . '1/sales/' . $paymentId . '/' . $this->type;
        $params = [];

        if ($this->amount != null) {
            $params['amount'] = $this->amount;
        }

        if ($this->serviceTaxAmount != null) {
            $params['serviceTaxAmount'] = $this->serviceTaxAmount;
        }

        $url .= '?' . http_build_query($params);

        return $this->sendRequest('PUT', $url);
    }
51985
public static function getById($paymentId, $apiContext = null)
    {
        if (isset($apiContext)) {
            return Payment::get($paymentId, $apiContext);
        }
        return Payment::get($paymentId);
    }
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');
    }
1141846
public function setOrderID($orderID)
    {
        if (!Icepay_Parameter_Validation::orderID($orderID))
            throw new Exception('The Order ID cannot be longer than 10 characters', 1007);

        $this->orderID = $orderID;
        return $this;
    }
136485
protected function setOrder($order_id)
    {
        $this->data_order = array();

        if (is_numeric($order_id)) {

            $this->data_order = $this->order->get($order_id);

            if (empty($this->data_order)) {
                $this->outputHttpStatus(404);
            }

            $this->order_history->setViewed($this->data_order);
            $this->prepareOrder($this->data_order);
        }
    }
429910
public function queryOrder($paymentId)
    {
        $params = [
            'appid' => $this->appId,
            'mch_id' => $this->mchId,
            'out_trade_no' => $paymentId,
            'nonce_str' => bin2hex(openssl_random_pseudo_bytes(8)),
        ];
        $params['sign'] = $this->createSign($params);
        $response = $this->api('https://api.mch.weixin.qq.com/pay/orderquery', 'POST', $params);
        if ($response->data['trade_state'] == 'SUCCESS') {
            Payment::setPayStatus($paymentId, true, ['pay_id' => $response->data['transaction_id'], 'message' => $response->data['return_msg']]);
            return true;
        }
        return false;
    }
34776
public function create($payment, $paymentId = null)
    {
        if (isset($paymentId)) {
            return $this->client()->put($payment, 'payments/{paymentId}', ['paymentId' => $paymentId]);
        }

        return $this->client()->post($payment, 'payments');
    }
220480
public function checkByOrderId($orderId)
    {
        // Clear the error variable
        $this->error = '';

        /**
         * Check value is string
         * If string return false and set error message on error variable
         */
        if (
        !self::__validateString($orderId, 1, 50)
        )
            return false;

        $param = array(
            "apikey" => $this->apiKey,
            "mob" => $this->mobile,
            "id" => $orderId
        );

        return self::__sendCheckRequest('invoice/byorderid', $param);
    }
1374001
public function loadProductById($productId)
    {
        $collection = $this->catalogCollection->create()
            ->addFieldToFilter('product_id', $productId)
            ->setPageSize(1);

        return $collection->getFirstItem();
    }
1179239
public static function getOrder($orderId) {
        $response = self::requestApi("get", null, $orderId);
        $body = $response->getBodyAsJson();
        $order = new Order($body["order"]);
        return $order;
    }
253292
public function getById(PaymentId $paymentId) : Payment
    {
        if (!array_key_exists((string)$paymentId, $this->payments)) {
            throw PaymentNotFoundException::byId($paymentId);
        }

        return $this->payments[(string)$paymentId];
    }
485107
public function loadByOrderIdAndQuoteId($orderId, $quoteId)
    {
        $collection = $this->addFieldToFilter('order_id', $orderId)
            ->addFieldToFilter('quote_id', $quoteId)
            ->setPageSize(1);

        if ($collection->getSize()) {
            return $collection->getFirstItem();
        }

        return false;
    }
168751
public function recentGame($gameId)
	{
		if ( ! isset($this->info['recentGames']))
		{
			// no rune pages
			return null;
		}
		$recentGames = $this->info['recentGames'];

		return $recentGames->game($gameId);
	}
546875
public function captureFull($paymentID, $amount = 0, $currency = '')
    {
        $obj = new stdClass();
        
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimestamp();
        $obj->amount = $amount;
        $obj->currency = $currency;
        $obj->PaymentID = $paymentID;
        
        // Generate checksum for the request
        $obj->Checksum = $this->generateChecksum($obj, $this->getSecretCode());
        
        // Make the request
        $request = $this->client->CaptureFull($obj);
        
        // Fetch the result
        $result = $request->CaptureFullResult;
        
        // Store result checksum
        $resultChecksum = $result->Checksum;
        
        // Remove result checksum from object
        unset($result->Checksum);
        
        // Create result checksum
        $checkSum = $this->generateChecksum($result, $this->getSecretCode());
        
        // Compare generated checksum and result checksum
        if ($resultChecksum !== $checkSum)
            throw new Exception('Data could not be verified');
        
        // Return result
        return $result;
    }