Builds PayPal request for express checkout.

@return \OxidEsales\PayPalModule\Model\PayPalRequest\PayPalRequest
438149
public function buildExpressCheckoutRequest()
    {
        $this->addBaseParams();
        $this->addCallBackUrl();
        $this->addBasketParams();
        $this->addDescriptionParams();
        $this->turnOffShippingAddressCollection();
        $this->setMaximumOrderAmount();

        if ($this->getShowCartInPayPal()) {
            $this->addBasketItemParams();
        } else {
            $this->addBasketGrandTotalParams();
        }
        $this->addAddressParams();

        return $this->getPayPalRequest();
    }
678821
public function getPayPalSandboxIpnUrl()
    {
        if (empty($this->payPalSandboxIpnUrl)) {
            $this->payPalSandboxIpnUrl = self::OEPAYPAL_SANDBOX_IPN_CALLBACK_URL;
        }

        return $this->payPalSandboxIpnUrl;
    }
845568
public function getPayPalConfig()
    {
        if (!$this->payPalConfig) {
            /** @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception */
            $exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
            throw $exception;
        }

        return $this->payPalConfig;
    }
518571
public function build() {
    $route_name = $this->routeMatch->getRouteName();
    if ($route_name !== 'acm_checkout.form') {
      return [];
    }

    // Load the CheckoutFlow plugin.
    $config = \Drupal::config('acm_checkout.settings');
    $checkout_flow_plugin = $config->get('checkout_flow_plugin') ?: 'multistep_default';
    $plugin_manager = \Drupal::service('plugin.manager.acm_checkout_flow');
    $checkout_flow = $plugin_manager->createInstance($checkout_flow_plugin, []);

    // Build the steps sent to the template.
    $steps = [];
    $visible_steps = array_filter($checkout_flow->getVisibleSteps(), function ($step_definition) {
      return (!isset($step_definition['hide_from_progress']));
    });
    $visible_step_ids = array_keys($visible_steps);
    $current_step_id = $checkout_flow->getStepId();
    $current_step_index = array_search($current_step_id, $visible_step_ids);

    // Get last step completed in the cart.
    $cart = $this->cartStorage;
    $cart_step_id = $cart->getCheckoutStep();
    $cart_step_index = array_search($cart_step_id, $visible_step_ids);

    $index = 0;
    foreach ($visible_steps as $step_id => $step_definition) {
      $is_link = FALSE;
      $completed = FALSE;
      if ($index < $current_step_index) {
        $position = 'previous';
      }
      elseif ($index == $current_step_index) {
        $position = 'current';
      }
      else {
        $position = 'next';
      }

      $label = $step_definition['label'];
      // Add a class if this step has been completed already.
      if ($index < $cart_step_index) {
        $completed = TRUE;
      }
      // Set the label to a link if this step has already been completed so that
      // the progress bar can be used as a sort of navigation.
      if ($index <= $cart_step_index && $index !== $current_step_index) {
        $is_link = TRUE;
        $label = Link::createFromRoute($label, 'acm_checkout.form', [
          'step' => $step_id,
        ])->toString();
      }

      $steps[] = [
        'id' => $step_id,
        'label' => $label,
        'position' => $position,
        'completed' => $completed,
        'is_link' => $is_link,
      ];

      $index++;
    }

    return [
      '#attached' => [
        'library' => ['acm_checkout/checkout_progress'],
      ],
      '#theme' => 'acm_checkout_progress',
      '#steps' => $steps,
    ];
  }
1321740
public function buildStandardCheckoutRequest()
    {
        $this->addBaseParams();
        $this->addBasketParams();
        $this->addDescriptionParams();
        $this->disableSelectingDifferentAddressInPayPal();
        $this->setMaximumOrderAmount();

        if ($this->getShowCartInPayPal()) {
            $this->addBasketItemParams();
        } else {
            $this->addBasketGrandTotalParams();
        }
        $this->addAddressParams();

        return $this->getPayPalRequest();
    }
191664
public function getPayPalSandboxApiUrl()
    {
        $url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxApiUrl');
        if ($url) {
            $this->setPayPalSandboxApiUrl($url);
        }

        return $this->payPalSandboxApiUrl;
    }
1008109
public function build(): GetBoxModelRequest
	{
		$instance = new GetBoxModelRequest();
		$instance->nodeId = $this->nodeId;
		$instance->backendNodeId = $this->backendNodeId;
		$instance->objectId = $this->objectId;
		return $instance;
	}
928502
public function buildPayment()
    {
        $return = null;

        // Setter forms request payment from request parameters.
        $requestOrderPayment = $this->prepareRequestOrderPayment();

        // Create order payment from database to check if it match created from request.
        $orderPayment = $this->loadOrderPayment($requestOrderPayment->getTransactionId());

        // Only need validate if there is order in database.
        // If request payment do not have matching payment with order return null.
        if ($orderPayment->getOrderId()) {
            // Validator change request payment by adding information if it is valid.
            $orderPayment = $this->addPaymentValidationInformation($requestOrderPayment, $orderPayment);
            $orderPayment = $this->changePaymentStatusInfo($requestOrderPayment, $orderPayment);
            $orderPayment->save();
            $return = $orderPayment;
        } else {
            //IPN request might be for a transaction that does not yet exist in the shop database.
            $paymentCreator = $this->getPaymentCreator();
            $return = $paymentCreator->handleOrderPayment($requestOrderPayment);
        }

        return $return;
    }
691026
public function doExpressCheckoutPayment($request)
    {
        $caller = $this->getCaller();
        $caller->setRequest($request);

        $response = oxNew(\OxidEsales\PayPalModule\Model\Response\ResponseDoExpressCheckoutPayment::class);
        $response->setData($caller->call('DoExpressCheckoutPayment'));

        return $response;
    }
908383
public function process()
    {
        $lang = $this->getLang();
        $request = $this->getRequest();
        $paymentBuilder = $this->getPaymentBuilder();
        $payPalOrderManager = $this->getOrderManager();

        // Create Payment from Request.
        $paymentBuilder->setLang($lang);
        $paymentBuilder->setRequest($request);
        $orderPayment = $paymentBuilder->buildPayment();

        $payPalOrderManager->setOrderPayment($orderPayment);
        $processSuccess = $payPalOrderManager->updateOrderStatus();

        return $processSuccess;
    }
1118792
public function getPayPalSandboxUrl()
    {
        $url = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxUrl');
        if ($url) {
            $this->setPayPalSandboxUrl($url);
        }

        return $this->payPalSandboxUrl;
    }
224648
public function getPayPalSandboxHost()
    {
        $host = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sPayPalSandboxHost');
        if ($host) {
            $this->setPayPalSandboxHost($host);
        }

        return $this->payPalSandboxHost;
    }
180571
public function request()
    {
        $transactions = $this->searchTransactions();

        if(count($transactions) > 0) {
            foreach ($transactions as $transaction) {
                $this->_arrayTransactions[] = array(
                    'date'           => $this->formatDate($transaction['created_at']),
                    'magento_id'     => $transaction['increment_id'],
                    'pagseguro_id'   => $transaction['transaction_code'],
                    'environment'    => $transaction['environment'],
                    'magento_status' => $this->formatMagentoStatus($transaction['status'], $transaction['partially_refunded']),
                    'order_id'       => $transaction['entity_id']
                );
            }
        }
        return $this->_arrayTransactions;
    }
540576
protected function buildPluginRequest()
    {
        /** @var $parentRequest ActionRequest */
        $parentRequest = $this->runtime->getControllerContext()->getRequest();
        $pluginRequest = new ActionRequest($parentRequest);

        if (!$this->pluginViewNode instanceof NodeInterface) {
            $pluginRequest->setArgumentNamespace('--' . $this->getPluginNamespace());
            $this->passArgumentsToPluginRequest($pluginRequest);
            $pluginRequest->setControllerPackageKey($this->getPackage());
            $pluginRequest->setControllerSubpackageKey($this->getSubpackage());
            $pluginRequest->setControllerName($this->getController());
            $pluginRequest->setControllerActionName($this->getAction());
            return $pluginRequest;
        }

        $pluginNodeIdentifier = $this->pluginViewNode->getProperty('plugin');
        if (strlen($pluginNodeIdentifier) === 0) {
            return $pluginRequest;
        }

        // Set the node to render this to the master plugin node
        $this->node = $this->pluginViewNode->getContext()->getNodeByIdentifier($pluginNodeIdentifier);
        if ($this->node === null) {
            return $pluginRequest;
        }

        $pluginRequest->setArgument('__node', $this->node);
        $pluginRequest->setArgumentNamespace('--' . $this->getPluginNamespace());
        $this->passArgumentsToPluginRequest($pluginRequest);

        if ($pluginRequest->getControllerObjectName() !== '') {
            return $pluginRequest;
        }

        $controllerObjectPairs = [];
        $pluginViewName = $this->pluginViewNode->getProperty('view');
        foreach ($this->pluginService->getPluginViewDefinitionsByPluginNodeType($this->node->getNodeType()) as $pluginViewDefinition) {
            /** @var PluginViewDefinition $pluginViewDefinition */
            if ($pluginViewDefinition->getName() !== $pluginViewName) {
                continue;
            }
            $controllerObjectPairs = $pluginViewDefinition->getControllerActionPairs();
            break;
        }

        if ($controllerObjectPairs === []) {
            return $pluginRequest;
        }

        $defaultControllerObjectName = key($controllerObjectPairs);
        $defaultActionName = current($controllerObjectPairs[$defaultControllerObjectName]);
        $pluginRequest->setControllerObjectName($defaultControllerObjectName);
        $pluginRequest->setControllerActionName($defaultActionName);

        return $pluginRequest;
    }
586652
protected function _buildRequest()
    {
        $this->_request = $this->_factory
            ->getNewCancelBuildRequest($this->_api, $this->_order)
            ->build();
        return $this;
    }
693606
private function buildCommitRequest()
    {
        $obj_request = (object)['mutations' => []];

        // Transaction at root level, so do not use applyTransaction()
        if(null !== $this->str_next_transaction) {
            $obj_request->transaction = $this->str_next_transaction;
            $obj_request->mode = self::MODE_TRANSACTIONAL;
            $this->str_next_transaction = null;
        } else {
            $obj_request->mode = self::MODE_NON_TRANSACTIONAL;
        }
        return $obj_request;
    }
1205638
public function getPayment()
    {
        if (!$this->isPayPal()) {
            // removing PayPal payment type from session
            $this->getSession()->deleteVariable('oepaypal');
            $this->getSession()->deleteVariable('oepaypal-basketAmount');

            return parent::getPayment();
        }

        if ($this->payment === null) {
            // payment is set ?
            $payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
            if ($payment->load('oxidpaypal')) {
                $this->payment = $payment;
            }
        }

        return $this->payment;
    }