Returns state if order info should be send to PayPal.

@return bool
347249
public function sendOrderInfoToPayPal()
    {
        $sendInfoToPayPalEnabled = $this->getPayPalConfig()->sendOrderInfoToPayPal();
        if ($sendInfoToPayPalEnabled) {
            /** @var \OxidEsales\PayPalModule\Model\Basket $basket */
            $basket = $this->getSession()->getBasket();
            $sendInfoToPayPalEnabled = !$basket->isFractionQuantityItemsPresent();
        }

        return $sendInfoToPayPalEnabled;
    }
178213
public function isPaid()
    {
        $response = array_get($this->data, 'response');
        if ($response) {
            $trade = array_get($response, 'trade');
            if (array_get($trade, 'trade_status')) {
                if (array_get($trade, 'trade_status') == 'TRADE_SUCCESS') {
                    return true;
                } elseif (array_get($trade, 'trade_status') == 'TRADE_FINISHED') {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
1302351
function check() {
    global $db;
    if (IS_ADMIN_FLAG === true) {
      global $sniffer;
      if ($sniffer->field_exists(TABLE_PAYPAL, 'zen_order_id'))  $db->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0'");
    }
    if (!isset($this->_check)) {
      $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");
      $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
  }
872763
protected function userPayment()
	{
		$this->refIf = Input::get('id_get');
		$trackingCode = Input::get('trans_id');

		if (is_numeric($trackingCode) && $trackingCode > 0) {
			$this->trackingCode = $trackingCode;
			return true;
		}

		$this->transactionFailed();
		$this->newLog(-4, PaylineReceiveException::$errors[-4]);
		throw new PaylineReceiveException(-4);
	}
91737
public function isValid()
    {
        if(empty($this->token) || empty($this->payerId) || is_null($this->_paymentDetails)) {
            return false;
        }

        $valid = true;
        foreach($this->_paymentDetails as $detail) {
            if(empty($detail)) {
                $valid = false;
                break;
            }

            $amt = $detail->getAmt();

            if(empty($amt)) {
                $valid = false;
                break;
            }
        }

        return $valid;
    }
1324089
public function isNewPayPalOrder()
    {
        $active = false;

        $order = $this->getEditObject();
        $orderPayPal = $order->getPayPalOrder();
        if ($this->isPayPalOrder() && $orderPayPal->isLoaded()) {
            $active = true;
        }

        return $active;
    }
593635
public function isActive()
    {
        //If check was made once return result
        if ($this->_blActive !== null) {
            return $this->_blActive;
        }

        //Check if payment method itself is active
        $sTable = getViewName('oxpayments');
        $sSql = "SELECT OXACTIVE
            FROM {$sTable}
            WHERE OXID = 'bestitamazon'";

        $blPaymentActive = (bool)$this->getDatabase()->getOne($sSql);

        if ($blPaymentActive === false) {
            return $this->_blActive = false;
        }

        //Check if payment has at least one shipping method assigned
        $sO2PTable = getViewName('oxobject2payment');
        $sDelSetTable = getViewName('oxdeliveryset');
        $sSql = "SELECT OXOBJECTID
            FROM {$sO2PTable} AS o2p RIGHT JOIN {$sDelSetTable} AS d 
              ON (o2p.OXOBJECTID = d.OXID AND d.OXACTIVE = 1)
            WHERE OXPAYMENTID = 'bestitamazon'
              AND OXTYPE='oxdelset'
            LIMIT 1";

        $sShippingId = (string)$this->getDatabase()->getOne($sSql);

        if ($sShippingId === '') {
            return $this->_blActive = false;
        }

        //Check if shipping method has at least one shipping cost assigned
        $sTable = getViewName('oxdel2delset');
        $sSql = "SELECT OXID 
            FROM {$sTable} 
            WHERE OXDELSETID = {$this->getDatabase()->quote($sShippingId)}
            LIMIT 1";
        $sShippingCostRelated = (string)$this->getDatabase()->getOne($sSql);

        if ($sShippingCostRelated === '') {
            return $this->_blActive = false;
        }

        //Check if selected currency is available for selected Amazon locale
        if ($this->getIsSelectedCurrencyAvailable() === false) {
            return $this->_blActive = false;
        }

        $oConfig = $this->getConfig();

        //If Amazon SellerId is empty
        if ((string)$oConfig->getConfigParam('sAmazonSellerId') === '') {
            return $this->_blActive = false;
        }

        //If basket items price = 0
        if ((string)$oConfig->getRequestParameter('cl') !== 'details'
            && (int)$this->getSession()->getBasket()->getPrice()->getBruttoPrice() === 0
        ) {
            return $this->_blActive = false;
        }

        return $this->_blActive = true;
    }
305329
protected function TransactionMatchesCurrentBasketState()
    {
        $bIsMatching = true;
        $this->GetTransactionStatus();
        if (!isset($this->aXMLResponseData['CURRENCY']) || $this->aXMLResponseData['CURRENCY'] != $this->GetCurrencyIdentifier()) {
            $bIsMatching = false;
        }
        if ($bIsMatching) {
            $oBasket = TShopBasket::GetInstance();
            $sBasketAmount = number_format(round($oBasket->dCostTotal * 100) / 100, 2, '.', '');
            if (!isset($this->aXMLResponseData['AMOUNT']) || $this->aXMLResponseData['AMOUNT'] != $sBasketAmount) {
                $bIsMatching = false;
            }
        }

        return $bIsMatching;
    }
612958
function in_special_checkout() {
    if ((defined('MODULE_PAYMENT_PAYPALDP_STATUS') && MODULE_PAYMENT_PAYPALDP_STATUS == 'True') &&
             !empty($_SESSION['paypal_ec_token']) &&
             !empty($_SESSION['paypal_ec_payer_id']) &&
             !empty($_SESSION['paypal_ec_payer_info'])) {
      return true;
    }
  }
494233
public function getStatus()
    {
        if (is_null($this->getOrder())) {
            return;
        }

        $status = $this->getOrderPaymentStatusFinal();

        if (is_null($status)) {
            $status = $this->getOrderPaymentStatusPaymentValid();
        }
        if (is_null($status)) {
            $status = $this->getOrderPaymentStatusPayments();
        }

        return $status;
    }
821890
protected function getPaymentStatusCreditNote()
    {
        return $this->source->getState() == \Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED
            ? Api::PaymentStatus_Paid
            : Api::PaymentStatus_Due;
    }
724682
public function isValid()
    {
        $payPalRequest = $this->getPayPalRequest();
        $payPalResponse = $this->getPayPalResponse();
        $shopOwnerUserName = $this->getShopOwnerUserName();
        $receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];

        return ($payPalResponse->isPayPalAck() && $receiverEmailPayPal == $shopOwnerUserName);
    }
518051
public function isSuccessful()
    {
        $isHttpSuccess = parent::isSuccessful();
        $isPurchaseSuccess = false;

        if (isset($this->data['paymentStatus']) && $this->data['paymentStatus'] == $this->successfulPaymentStatus) {
            $isPurchaseSuccess = true;
        }

        return ($isHttpSuccess && $isPurchaseSuccess);
    }
249158
public function isPayPalCheckValid()
    {
        $newBasketAmount = $this->getNewBasketAmount();
        $prevBasketAmount = $this->getOldBasketAmount();
        // check only if new price is different and bigger than old price
        if ($newBasketAmount > $prevBasketAmount) {
            return false;
        }

        return true;
    }
760387
public function onCharge($order)
    {
        $this->statusCode = 'pending';

        // Begin paypal
        try {

            if ($order->total <= 0) {
            
                $this->statusCode = 'completed';

                $this->detail = 'Order total is 0; no PayPal transaction required.';

                $this->transactionId = uniqid();

                return true;
            }

            $this->setContext();

            $payer = new Payer();
        
            $payer->setPaymentMethod('paypal');

            $list = new ItemList();
            
            $list->setItems($this->toPayPalItems($order));
            
            $details = new Details();
            
            $details->setShipping($order->totalShipping)
                ->setTax($order->totalTax)
                ->setSubtotal($order->totalPrice);

            $amount = new Amount();

            $amount->setCurrency(Config::get('shop.currency'))
                ->setTotal($order->total)
                ->setDetails($details);

            $transaction = new Transaction();

            $transaction->setAmount($amount)
                ->setItemList($list)
                ->setDescription(sprintf(
                    '%s payment, Order #%d',
                    Config::get('shop.name'),
                    $order->id
                ))
                ->setInvoiceNumber($order->id);

            $redirectUrls = new RedirectUrls();
            
            $redirectUrls->setReturnUrl($this->callbackSuccess)
                ->setCancelUrl($this->callbackFail);

            $payment = new Payment();

            $payment->setIntent('sale')
                ->setPayer($payer)
                ->setRedirectUrls($redirectUrls)
                ->setTransactions([$transaction]);

            //$request = clone $payment;

            $payment->create($this->apiContext);

            $this->approvalUrl = $payment->getApprovalLink();

            $this->detail = sprintf('Pending approval: %s', $this->approvalUrl);

            return true;

        } catch (PayPalConnectionException $e) {

            $response = json_decode($e->getData());

            throw new GatewayException(
                sprintf(
                    '%s: %s',
                    $response->name,
                    isset($response->message) ? $response->message : 'Paypal payment Failed.'
                ),
                1001,
                $e
            );

        } catch (\Exception $e) {

            throw new GatewayException(
                $e->getMessage(),
                1000,
                $e
            );

        }

        return false;
    }
600157
public function getRequest()
    {
        if ($this->request === null) {
            $this->request = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest::class);
        }

        return $this->request;
    }
565745
function confirmation() {
    $confirmation = array('title' => '',
                          'fields' => array(array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_FIRSTNAME,
                                                  'field' => $_POST['paypalwpp_cc_firstname']),
                                            array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_LASTNAME,
                                                  'field' => $_POST['paypalwpp_cc_lastname']),
                                            array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_TYPE,
                                                  'field' => $this->cc_card_type),
                                            array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_NUMBER,
                                                  'field' => substr($_POST['paypalwpp_cc_number'], 0, 4) . str_repeat('X', (strlen($_POST['paypalwpp_cc_number']) - 8)) . substr($_POST['paypalwpp_cc_number'], -4)),
                                            array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_EXPIRES,
                                                  'field' => strftime('%B, %Y', mktime(0,0,0,$_POST['paypalwpp_cc_expires_month'], 1, '20' . $_POST['paypalwpp_cc_expires_year'])),
                                            (isset($_POST['paypalwpp_cc_issuenumber']) ? array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_ISSUE_NUMBER,
                                                  'field' => $_POST['paypalwpp_cc_issuenumber']) : '')
                                            )));
    // 3D-Secure
    if (MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY == 'UK' && $this->requiresLookup($_POST['paypalwpp_cc_number']) == true) {
          $confirmation['fields'][count($confirmation['fields'])] = array(
              'title' => '',
              'field' => '<div id="' . $this->code.'-cc-securetext"><p>' .
                         '<a href="javascript:void window.open(\'vbv_learn_more.html\',\'vbv_service\',\'width=550,height=450\')">' .
                         zen_image(DIR_WS_IMAGES.'3ds/vbv_learn_more.gif') . '</a>' .
                         '<a href="javascript:void window.open(\'mcs_learn_more.html\',\'mcsc_service\',\'width=550,height=450\')">' .
                         zen_image(DIR_WS_IMAGES.'3ds/mcsc_learn_more.gif') . '</a></p>' .
                         '<p>' . TEXT_3DS_CARD_MAY_BE_ENROLLED . '</p></div>');
    }
    return $confirmation;
  }