Controller/ExpressCheckoutDispatcher.php
protected function setParamsForCallbackResponse($payPalService)
    {
        //logging request from PayPal
        $logger = $this->getLogger();
        $logger->setTitle("CALLBACK REQUEST FROM PAYPAL");
        $logger->log(http_build_query($_REQUEST, "", "&"));

        // initializing user..
        $user = $this->getCallBackUser($_REQUEST);

        // unknown country?
        if (!$this->getUserShippingCountryId($user)) {
            $logger = $this->getLogger();
            $logger->log("Callback error: NO SHIPPING COUNTRY ID");

            // unknown country - no delivery
            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        //basket
        $basket = $this->getSession()->getBasket();

        // get possible delivery sets
        $delSetList = $this->getDeliverySetList($user);

        //no shipping methods for user country
        if (!count($delSetList)) {
            $logger = $this->getLogger();
            $logger->log("Callback error: NO DELIVERY LIST SET");

            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $deliverySetList = $this->makeUniqueNames($delSetList);

        // checking if PayPal is valid payment for selected user country
        if (!$this->isPaymentValidForUserCountry($user)) {
            $logger->log("Callback error: NOT VALID COUNTRY ID");

            // PayPal payment is not possible for user country
            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $this->getSession()->setVariable('oepaypal-oxDelSetList', $deliverySetList);

        $totalDeliveries = $this->setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket);

        // if none of deliveries contain PayPal - disabling PayPal
        if ($totalDeliveries == 0) {
            $logger->log("Callback error: DELIVERY SET LIST HAS NO PAYPAL");

            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $payPalService->setParameter("OFFERINSURANCEOPTION", "false");
    }
protected function setParamsForCallbackResponse($payPalService)
    {
        //logging request from PayPal
        $logger = $this->getLogger();
        $logger->setTitle("CALLBACK REQUEST FROM PAYPAL");
        $logger->log(http_build_query($_REQUEST, "", "&"));

        // initializing user..
        $user = $this->getCallBackUser($_REQUEST);

        // unknown country?
        if (!$this->getUserShippingCountryId($user)) {
            $logger = $this->getLogger();
            $logger->log("Callback error: NO SHIPPING COUNTRY ID");

            // unknown country - no delivery
            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        //basket
        $basket = $this->getSession()->getBasket();

        // get possible delivery sets
        $delSetList = $this->getDeliverySetList($user);

        //no shipping methods for user country
        if (!count($delSetList)) {
            $logger = $this->getLogger();
            $logger->log("Callback error: NO DELIVERY LIST SET");

            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $deliverySetList = $this->makeUniqueNames($delSetList);

        // checking if PayPal is valid payment for selected user country
        if (!$this->isPaymentValidForUserCountry($user)) {
            $logger->log("Callback error: NOT VALID COUNTRY ID");

            // PayPal payment is not possible for user country
            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $this->getSession()->setVariable('oepaypal-oxDelSetList', $deliverySetList);

        $totalDeliveries = $this->setDeliverySetListForCallbackResponse($payPalService, $deliverySetList, $user, $basket);

        // if none of deliveries contain PayPal - disabling PayPal
        if ($totalDeliveries == 0) {
            $logger->log("Callback error: DELIVERY SET LIST HAS NO PAYPAL");

            $this->setPayPalIsNotAvailable($payPalService);

            return;
        }

        $payPalService->setParameter("OFFERINSURANCEOPTION", "false");
    }
protected function setParamsForCallbackResponse ( $ payPalService ) { //logging request from PayPal $ logger = $ this -> getLogger ( ) ; $ logger -> setTitle ( "CALLBACK REQUEST FROM PAYPAL" ) ; $ logger -> log ( http_build_query ( $ _REQUEST , "" , "&" ) ) ; // initializing user.. $ user = $ this -> getCallBackUser ( $ _REQUEST ) ; // unknown country? if ( ! $ this -> getUserShippingCountryId ( $ user ) ) { $ logger = $ this -> getLogger ( ) ; $ logger -> log ( "Callback error: NO SHIPPING COUNTRY ID" ) ; // unknown country - no delivery $ this -> setPayPalIsNotAvailable ( $ payPalService ) ; return ; } //basket $ basket = $ this -> getSession ( ) -> getBasket ( ) ; // get possible delivery sets $ delSetList = $ this -> getDeliverySetList ( $ user ) ; //no shipping methods for user country if ( ! count ( $ delSetList ) ) { $ logger = $ this -> getLogger ( ) ; $ logger -> log ( "Callback error: NO DELIVERY LIST SET" ) ; $ this -> setPayPalIsNotAvailable ( $ payPalService ) ; return ; } $ deliverySetList = $ this -> makeUniqueNames ( $ delSetList ) ; // checking if PayPal is valid payment for selected user country if ( ! $ this -> isPaymentValidForUserCountry ( $ user ) ) { $ logger -> log ( "Callback error: NOT VALID COUNTRY ID" ) ; // PayPal payment is not possible for user country $ this -> setPayPalIsNotAvailable ( $ payPalService ) ; return ; } $ this -> getSession ( ) -> setVariable ( 'oepaypal-oxDelSetList' , $ deliverySetList ) ; $ totalDeliveries = $ this -> setDeliverySetListForCallbackResponse ( $ payPalService , $ deliverySetList , $ user , $ basket ) ; // if none of deliveries contain PayPal - disabling PayPal if ( $ totalDeliveries == 0 ) { $ logger -> log ( "Callback error: DELIVERY SET LIST HAS NO PAYPAL" ) ; $ this -> setPayPalIsNotAvailable ( $ payPalService ) ; return ; } $ payPalService -> setParameter ( "OFFERINSURANCEOPTION" , "false" ) ; }
Sets parameters to PayPal callback

@param \OxidEsales\PayPalModule\Core\PayPalService $payPalService PayPal service

@return null
Sets parameters to PayPal callback