Get user payment instance related to the order.

@return oxUserPayment
480273
public function getPaymorrowOxUserPaymentReloaded()
    {
        $sUserPaymentId = $this->oxorder__oxpaymentid->value;

        /** @var oxUserPayment $oUserPayment */
        $oUserPayment = oxNew( 'oxUserPayment' );
        $oUserPayment->load( $sUserPaymentId );

        return $oUserPayment;
    }
870348
public function getPayPalPayment()
    {
        if ($this->payPalPayment === null) {
            $this->payPalPayment = false;
            $payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);

            // payment is not available/active?
            if ($payPalPayment->load("oxidpaypal") && $payPalPayment->oxpayments__oxactive->value) {
                $this->payPalPayment = $payPalPayment;
            }
        }

        return $this->payPalPayment;
    }
1248719
public function getPaymorrowTotalAmount()
    {
        /** @var OxpsPaymorrowOxBasket|oxBasket $this */

        $dTotalPrice = (double) $this->getPrice()->getPrice();

        // Add surcharge price in case it is not yet included in basket
        $oSurchargePrice = $this->_getPaymentMethodSurcharge();

        if ( !empty( $oSurchargePrice ) and is_object( $oSurchargePrice ) ) {
            $dTotalPrice += (double) $oSurchargePrice->getPrice();
        }

        return $dTotalPrice;
    }
1194260
protected function userPayment()
    {
        $ReturningParams = Input::get('ReturningParams');
        $ReturningParams = $this->decrypt($ReturningParams);

        $paramsArray = explode(",", $ReturningParams);
        $Amount = $paramsArray[0];
        $SaleOrderId = $paramsArray[1];
        $RefId = $paramsArray[2];
        $ResCode = $paramsArray[3];
        $ResMessage = $paramsArray[4];
        $PayGateTranID = $paramsArray[5];
        $RRN = $paramsArray[6];
        $LastFourDigitOfPAN = $paramsArray[7];


        $this->trackingCode = $PayGateTranID;
        $this->cardNumber = $LastFourDigitOfPAN;
        $this->refId = $RefId;


        if ($ResCode == '0' || $ResCode == '00') {
            return true;
        }

        $this->transactionFailed();
        $this->newLog($ResCode, $ResMessage . " - " . AsanpardakhtException::getMessageByCode($ResCode));
        throw new AsanpardakhtException($ResCode);
    }
871212
public function getPayment()
    {
        if (is_null($this->payment)) {
            $payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
            $payPalPayment->load('oxidpaypal');
            $this->setPayment($payPalPayment);
        }

        return $this->payment;
    }
1158397
public function getPaymentMethod()
    {
        if (isset($this->source->order_payment_id)) {
            return $this->source->order_payment_id;
        }
        return parent::getPaymentMethod();
    }
1186866
protected function _getPaymentId()
    {
        /** @var OxpsPaymorrowOxBasket|oxBasket $this */

        $sId = (string) $this->getPaymentId();

        if ( !empty( $sId ) ) {
            $sId = $this->_toUtf( $sId );
        } else {
            $sId = 'PaymentId';
        }

        return $sId;
    }
766793
protected function getPaymentDateOrder()
    {
        // Take date of last payment as payment date.
        $paymentDate = null;
        foreach ($this->source->getStatusHistoryCollection() as $statusChange) {
            /** @var \Mage_Sales_Model_Order_Status_History $statusChange */
            if (!$paymentDate || $this->isPaidStatus($statusChange->getStatus())) {
                $createdAt = substr($statusChange->getCreatedAt(), 0, strlen('yyyy-mm-dd'));
                if (!$paymentDate || $createdAt < $paymentDate) {
                    $paymentDate = $createdAt;
                }
            }
        }
        return $paymentDate;
    }
748743
public function getOrderPaymentSetter()
    {
        if (is_null($this->payPalIPNPaymentSetter)) {
            $payPalIPNPaymentSetter = oxNew(\OxidEsales\PayPalModule\Model\IPNRequestPaymentSetter::class);
            $this->setOrderPaymentSetter($payPalIPNPaymentSetter);
        }

        return $this->payPalIPNPaymentSetter;
    }
843547
public function getPaymentList()
    {
        if (is_null($this->paymentList)) {
            $paymentList = oxNew(\OxidEsales\PayPalModule\Model\OrderPaymentList::class);
            $paymentList->load($this->getOrderId());
            $this->setPaymentList($paymentList);
        }

        return $this->paymentList;
    }
748467
public function getUserPayments($sOXID = null)
    {
        if ($this->_oPayments === null) {
            if (!$sOXID) {
                $sOXID = $this->getId();
            }

            $sSelect = 'select * from oxuserpayments where oxuserid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID) . ' ';

            $this->_oPayments = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
            $this->_oPayments->init('oxUserPayment');
            $this->_oPayments->selectString($sSelect);
        }

        return $this->_oPayments;
    }
1146616
public function getOrderLink()
    {
        if (($sValue = $this->getViewConfigParam('orderlink')) === null) {
            $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=user';
            $this->setViewConfigParam('orderlink', $sValue);
        }

        return $sValue;
    }
913078
public function &GetPaymentHandler()
    {
        $oPaymentHandler = $this->GetFromInternalCache('oOrderPaymentHandler');
        if (is_null($oPaymentHandler)) {
            $oPaymentMethod = $this->GetFieldShopPaymentMethod();
            if ($oPaymentMethod) {
                $aParameter = array();
                $oPaymentParameterList = $this->GetFieldShopOrderPaymentMethodParameterList();
                while ($oParam = $oPaymentParameterList->Next()) {
                    $aParameter[$oParam->fieldName] = $oParam->fieldValue;
                }
                try {
                    $oPaymentHandler = $this->getShopPaymentHandlerFactory()->createPaymentHandler($oPaymentMethod->fieldShopPaymentHandlerId, $this->fieldCmsPortalId, $aParameter);
                    $this->SetInternalCache('oOrderPaymentHandler', $oPaymentHandler);
                } catch (ConfigurationException $e) {
                    $this->getLogger()->error(
                        sprintf('Unable to create payment handler: %s', $e->getMessage()),
                        [
                            'paymentHandlerId' => $oPaymentMethod->fieldShopPaymentHandlerId,
                            'portalId' => $this->fieldCmsPortalId,
                        ]
                    );
                }
            }
        }

        return $oPaymentHandler;
    }
1343624
public function request()
    {
        //load payments by date
        $this->getPagSeguroAbandoned();

        if ($this->_PagSeguroPaymentList->getTransactions()) {
            foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                date_default_timezone_set('UTC');
                $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
                $order = $this->_order->load($order);
                if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt(
                        $payment->getReference())
                ) {
                    if (!is_null($this->_session->getData('store_id'))) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                    if ($order) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                }
            }
        }
        date_default_timezone_set($this->_timezone->getConfigTimezone());

        return $this->_arrayPayments;
    }
1311339
public function getPayPalOrder($oxId = null)
    {
        if (is_null($this->payPalOrder)) {
            $orderId = is_null($oxId) ? $this->getId() : $oxId;
            $order = oxNew(\OxidEsales\PayPalModule\Model\PayPalOrder::class);
            $order->load($orderId);
            $this->payPalOrder = $order;
        }

        return $this->payPalOrder;
    }
1246858
public function getSelUserPayment()
    {
        if ($this->_oUserPayment == null) {
            $this->_oUserPayment = false;
            $sPaymentId = $this->getPaymentId();
            if ($sPaymentId != "-1" && isset($sPaymentId)) {
                $this->_oUserPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
                $this->_oUserPayment->load($sPaymentId);
                $sTemplate = $this->_oUserPayment->oxuserpayments__oxvalue->value;

                // generate selected paymenttype
                $oPaymentTypes = $this->getPaymentTypes();
                foreach ($oPaymentTypes as $oPayment) {
                    if ($oPayment->oxpayments__oxid->value == $this->_oUserPayment->oxuserpayments__oxpaymentsid->value) {
                        $oPayment->selected = 1;
                        // if there are no values assigned we set default from paymenttype
                        if (!$sTemplate) {
                            $sTemplate = $oPayment->oxpayments__oxvaldesc->value;
                        }
                        break;
                    }
                }
                $this->_oUserPayment->setDynValues(\OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($sTemplate));
            }
        }

        return $this->_oUserPayment;
    }
1326593
public function getPayPalPayCostVat()
    {
        $paymentVAT = 0.0;

        $paymentCost = $this->getCosts('oxpayment');
        if ($paymentCost && $paymentCost->getVatValue()) {
            $paymentVAT = $paymentCost->getVatValue();
        }

        return $paymentVAT;
    }