Model/PayPalRequest/SetExpressCheckoutRequestBuilder.php
public function addBasketParams()
    {
        $request = $this->getPayPalRequest();
        $basket = $this->getBasket();

        $virtualBasket = $basket->isVirtualPayPalBasket();

        // only downloadable products? missing getter on oxBasket yet
        $request->setParameter("NOSHIPPING", $virtualBasket ? "1" : "0");

        if ($virtualBasket) {
            $request->setParameter("REQCONFIRMSHIPPING", "0");
        }
        // passing basket VAT (tax) value. It is required as in Net mode articles are without VAT, but basket is with VAT.
        // PayPal need this value to check if all articles sum match basket sum.
        if ($basket->isCalculationModeNetto()) {
            $request->setParameter("PAYMENTREQUEST_0_TAXAMT", $this->formatFloat($basket->getPayPalBasketVatValue()));
        }

        $request->setParameter("PAYMENTREQUEST_0_AMT", $this->formatFloat($basket->getPrice()->getBruttoPrice()));
        $request->setParameter("PAYMENTREQUEST_0_CURRENCYCODE", $basket->getBasketCurrency()->name);
        $request->setParameter("PAYMENTREQUEST_0_ITEMAMT", $this->formatFloat($basket->getSumOfCostOfAllItemsPayPalBasket()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPPINGAMT", $this->formatFloat($basket->getDeliveryCosts()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPDISCAMT", $this->formatFloat($basket->getDiscountSumPayPalBasket() * -1));

        $delivery = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySet::class);
        $deliveryName = ($delivery->load($basket->getShippingId())) ? $delivery->oxdeliveryset__oxtitle->value : "#1";

        $request->setParameter("L_SHIPPINGOPTIONISDEFAULT0", "true");
        $request->setParameter("L_SHIPPINGOPTIONNAME0", $deliveryName);
        $request->setParameter("L_SHIPPINGOPTIONAMOUNT0", $this->formatFloat($basket->getDeliveryCosts()));
    }
public function addBasketParams()
    {
        $request = $this->getPayPalRequest();
        $basket = $this->getBasket();

        $virtualBasket = $basket->isVirtualPayPalBasket();

        // only downloadable products? missing getter on oxBasket yet
        $request->setParameter("NOSHIPPING", $virtualBasket ? "1" : "0");

        if ($virtualBasket) {
            $request->setParameter("REQCONFIRMSHIPPING", "0");
        }
        // passing basket VAT (tax) value. It is required as in Net mode articles are without VAT, but basket is with VAT.
        // PayPal need this value to check if all articles sum match basket sum.
        if ($basket->isCalculationModeNetto()) {
            $request->setParameter("PAYMENTREQUEST_0_TAXAMT", $this->formatFloat($basket->getPayPalBasketVatValue()));
        }

        $request->setParameter("PAYMENTREQUEST_0_AMT", $this->formatFloat($basket->getPrice()->getBruttoPrice()));
        $request->setParameter("PAYMENTREQUEST_0_CURRENCYCODE", $basket->getBasketCurrency()->name);
        $request->setParameter("PAYMENTREQUEST_0_ITEMAMT", $this->formatFloat($basket->getSumOfCostOfAllItemsPayPalBasket()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPPINGAMT", $this->formatFloat($basket->getDeliveryCosts()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPDISCAMT", $this->formatFloat($basket->getDiscountSumPayPalBasket() * -1));

        $delivery = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySet::class);
        $deliveryName = ($delivery->load($basket->getShippingId())) ? $delivery->oxdeliveryset__oxtitle->value : "#1";

        $request->setParameter("L_SHIPPINGOPTIONISDEFAULT0", "true");
        $request->setParameter("L_SHIPPINGOPTIONNAME0", $deliveryName);
        $request->setParameter("L_SHIPPINGOPTIONAMOUNT0", $this->formatFloat($basket->getDeliveryCosts()));
    }
public function addBasketParams ( ) { $ request = $ this -> getPayPalRequest ( ) ; $ basket = $ this -> getBasket ( ) ; $ virtualBasket = $ basket -> isVirtualPayPalBasket ( ) ; // only downloadable products? missing getter on oxBasket yet $ request -> setParameter ( "NOSHIPPING" , $ virtualBasket ? "1" : "0" ) ; if ( $ virtualBasket ) { $ request -> setParameter ( "REQCONFIRMSHIPPING" , "0" ) ; } // passing basket VAT (tax) value. It is required as in Net mode articles are without VAT, but basket is with VAT. // PayPal need this value to check if all articles sum match basket sum. if ( $ basket -> isCalculationModeNetto ( ) ) { $ request -> setParameter ( "PAYMENTREQUEST_0_TAXAMT" , $ this -> formatFloat ( $ basket -> getPayPalBasketVatValue ( ) ) ) ; } $ request -> setParameter ( "PAYMENTREQUEST_0_AMT" , $ this -> formatFloat ( $ basket -> getPrice ( ) -> getBruttoPrice ( ) ) ) ; $ request -> setParameter ( "PAYMENTREQUEST_0_CURRENCYCODE" , $ basket -> getBasketCurrency ( ) -> name ) ; $ request -> setParameter ( "PAYMENTREQUEST_0_ITEMAMT" , $ this -> formatFloat ( $ basket -> getSumOfCostOfAllItemsPayPalBasket ( ) ) ) ; $ request -> setParameter ( "PAYMENTREQUEST_0_SHIPPINGAMT" , $ this -> formatFloat ( $ basket -> getDeliveryCosts ( ) ) ) ; $ request -> setParameter ( "PAYMENTREQUEST_0_SHIPDISCAMT" , $ this -> formatFloat ( $ basket -> getDiscountSumPayPalBasket ( ) * - 1 ) ) ; $ delivery = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ DeliverySet :: class ) ; $ deliveryName = ( $ delivery -> load ( $ basket -> getShippingId ( ) ) ) ? $ delivery -> oxdeliveryset__oxtitle -> value : "#1" ; $ request -> setParameter ( "L_SHIPPINGOPTIONISDEFAULT0" , "true" ) ; $ request -> setParameter ( "L_SHIPPINGOPTIONNAME0" , $ deliveryName ) ; $ request -> setParameter ( "L_SHIPPINGOPTIONAMOUNT0" , $ this -> formatFloat ( $ basket -> getDeliveryCosts ( ) ) ) ; }
Sets basket parameters to request.
Sets basket parameters to request .