Controller/ExpressCheckoutDispatcher.php
protected function isPaymentValidForUserCountry($user)
    {
        $payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
        $payment->load("oxidpaypal");
        $paymentCountries = $payment->getCountries();

        if (!is_array($paymentCountries) || empty($paymentCountries)) {
            // not assigned to any country - valid to all countries
            return true;
        }

        return in_array($this->getUserShippingCountryId($user), $paymentCountries);
    }
protected function isPaymentValidForUserCountry($user)
    {
        $payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
        $payment->load("oxidpaypal");
        $paymentCountries = $payment->getCountries();

        if (!is_array($paymentCountries) || empty($paymentCountries)) {
            // not assigned to any country - valid to all countries
            return true;
        }

        return in_array($this->getUserShippingCountryId($user), $paymentCountries);
    }
protected function isPaymentValidForUserCountry ( $ user ) { $ payment = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Payment :: class ) ; $ payment -> load ( "oxidpaypal" ) ; $ paymentCountries = $ payment -> getCountries ( ) ; if ( ! is_array ( $ paymentCountries ) || empty ( $ paymentCountries ) ) { // not assigned to any country - valid to all countries return true ; } return in_array ( $ this -> getUserShippingCountryId ( $ user ) , $ paymentCountries ) ; }
Checking if PayPal payment is available in user country

@param \OxidEsales\Eshop\Application\Model\User $user User object.

@return boolean
Checking if PayPal payment is available in user country