Model/PaymentGateway.php
public function doExpressCheckoutPayment()
    {
        $success = false;
        $order = $this->getPayPalOrder();

        try {
            // updating order state
            if ($order) {
                $order->oePayPalUpdateOrderNumber();
                $session = $this->getSession();
                $basket = $session->getBasket();

                $transactionMode = $this->getTransactionMode($basket);

                $builder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\DoExpressCheckoutPaymentRequestBuilder::class);
                $builder->setPayPalConfig($this->getPayPalConfig());
                $builder->setSession($session);
                $builder->setBasket($basket);
                $builder->setTransactionMode($transactionMode);
                $builder->setUser($this->getPayPalUser());
                $builder->setOrder($order);

                $request = $builder->buildRequest();

                $payPalService = $this->getPayPalCheckoutService();
                $result = $payPalService->doExpressCheckoutPayment($request);

                $order->finalizePayPalOrder(
                    $result,
                    $session->getBasket(),
                    $transactionMode
                );

                $success = true;
            } else {
                /**
                 * @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
                 */
                $exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'OEPAYPAL_ORDER_ERROR');
                throw $exception;
            }
        } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
            // deleting order on error
            if ($order) {
                $order->deletePayPalOrder();
            }

            $this->_iLastErrorNo = \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR;
            $utilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
            $utilsView->addErrorToDisplay($exception);
        }

        return $success;
    }
public function doExpressCheckoutPayment()
    {
        $success = false;
        $order = $this->getPayPalOrder();

        try {
            // updating order state
            if ($order) {
                $order->oePayPalUpdateOrderNumber();
                $session = $this->getSession();
                $basket = $session->getBasket();

                $transactionMode = $this->getTransactionMode($basket);

                $builder = oxNew(\OxidEsales\PayPalModule\Model\PayPalRequest\DoExpressCheckoutPaymentRequestBuilder::class);
                $builder->setPayPalConfig($this->getPayPalConfig());
                $builder->setSession($session);
                $builder->setBasket($basket);
                $builder->setTransactionMode($transactionMode);
                $builder->setUser($this->getPayPalUser());
                $builder->setOrder($order);

                $request = $builder->buildRequest();

                $payPalService = $this->getPayPalCheckoutService();
                $result = $payPalService->doExpressCheckoutPayment($request);

                $order->finalizePayPalOrder(
                    $result,
                    $session->getBasket(),
                    $transactionMode
                );

                $success = true;
            } else {
                /**
                 * @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
                 */
                $exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, 'OEPAYPAL_ORDER_ERROR');
                throw $exception;
            }
        } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) {
            // deleting order on error
            if ($order) {
                $order->deletePayPalOrder();
            }

            $this->_iLastErrorNo = \OxidEsales\Eshop\Application\Model\Order::ORDER_STATE_PAYMENTERROR;
            $utilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();
            $utilsView->addErrorToDisplay($exception);
        }

        return $success;
    }
public function doExpressCheckoutPayment ( ) { $ success = false ; $ order = $ this -> getPayPalOrder ( ) ; try { // updating order state if ( $ order ) { $ order -> oePayPalUpdateOrderNumber ( ) ; $ session = $ this -> getSession ( ) ; $ basket = $ session -> getBasket ( ) ; $ transactionMode = $ this -> getTransactionMode ( $ basket ) ; $ builder = oxNew ( \ OxidEsales \ PayPalModule \ Model \ PayPalRequest \ DoExpressCheckoutPaymentRequestBuilder :: class ) ; $ builder -> setPayPalConfig ( $ this -> getPayPalConfig ( ) ) ; $ builder -> setSession ( $ session ) ; $ builder -> setBasket ( $ basket ) ; $ builder -> setTransactionMode ( $ transactionMode ) ; $ builder -> setUser ( $ this -> getPayPalUser ( ) ) ; $ builder -> setOrder ( $ order ) ; $ request = $ builder -> buildRequest ( ) ; $ payPalService = $ this -> getPayPalCheckoutService ( ) ; $ result = $ payPalService -> doExpressCheckoutPayment ( $ request ) ; $ order -> finalizePayPalOrder ( $ result , $ session -> getBasket ( ) , $ transactionMode ) ; $ success = true ; } else { /**
                 * @var $exception \OxidEsales\Eshop\Core\Exception\StandardException
                 */ $ exception = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class , 'OEPAYPAL_ORDER_ERROR' ) ; throw $ exception ; } } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException $ exception ) { // deleting order on error if ( $ order ) { $ order -> deletePayPalOrder ( ) ; } $ this -> _iLastErrorNo = \ OxidEsales \ Eshop \ Application \ Model \ Order :: ORDER_STATE_PAYMENTERROR ; $ utilsView = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) ; $ utilsView -> addErrorToDisplay ( $ exception ) ; } return $ success ; }
Executes "DoExpressCheckoutPayment" to PayPal

@return bool
Executes DoExpressCheckoutPayment to PayPal