public function isAvailable( MShop_Order_Item_Base_Interface $basket )
	{
		$addresses = $basket->getAddresses();

		$paymentType = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT;
		$deliveryType = MShop_Order_Item_Base_Address_Abstract::TYPE_DELIVERY;


		if( isset( $addresses[$deliveryType] ) )
		{
			$code = strtoupper( $addresses[$deliveryType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.delivery-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.delivery-exclude' ) === true
			) {
				return false;
			}
		}
		else if( isset( $addresses[$paymentType] ) ) // use billing address if no delivery address is available
		{
			$code = strtoupper( $addresses[$paymentType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.delivery-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.delivery-exclude' ) === true
			) {
				return false;
			}
		}

		if( isset( $addresses[$paymentType] ) )
		{
			$code = strtoupper( $addresses[$paymentType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.billing-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.billing-exclude' ) === true
			) {
				return false;
			}
		}

		return $this->_getProvider()->isAvailable( $basket );
	}
public function isAvailable( MShop_Order_Item_Base_Interface $basket )
	{
		$addresses = $basket->getAddresses();

		$paymentType = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT;
		$deliveryType = MShop_Order_Item_Base_Address_Abstract::TYPE_DELIVERY;


		if( isset( $addresses[$deliveryType] ) )
		{
			$code = strtoupper( $addresses[$deliveryType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.delivery-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.delivery-exclude' ) === true
			) {
				return false;
			}
		}
		else if( isset( $addresses[$paymentType] ) ) // use billing address if no delivery address is available
		{
			$code = strtoupper( $addresses[$paymentType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.delivery-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.delivery-exclude' ) === true
			) {
				return false;
			}
		}

		if( isset( $addresses[$paymentType] ) )
		{
			$code = strtoupper( $addresses[$paymentType]->getCountryId() );

			if( $this->_checkCountryCode( $code, 'country.billing-include' ) === false
				|| $this->_checkCountryCode( $code, 'country.billing-exclude' ) === true
			) {
				return false;
			}
		}

		return $this->_getProvider()->isAvailable( $basket );
	}
public function isAvailable ( MShop_Order_Item_Base_Interface $ basket ) { $ addresses = $ basket -> getAddresses ( ) ; $ paymentType = MShop_Order_Item_Base_Address_Abstract :: TYPE_PAYMENT ; $ deliveryType = MShop_Order_Item_Base_Address_Abstract :: TYPE_DELIVERY ; if ( isset ( $ addresses [ $ deliveryType ] ) ) { $ code = strtoupper ( $ addresses [ $ deliveryType ] -> getCountryId ( ) ) ; if ( $ this -> _checkCountryCode ( $ code , 'country.delivery-include' ) === false || $ this -> _checkCountryCode ( $ code , 'country.delivery-exclude' ) === true ) { return false ; } } else if ( isset ( $ addresses [ $ paymentType ] ) ) // use billing address if no delivery address is available { $ code = strtoupper ( $ addresses [ $ paymentType ] -> getCountryId ( ) ) ; if ( $ this -> _checkCountryCode ( $ code , 'country.delivery-include' ) === false || $ this -> _checkCountryCode ( $ code , 'country.delivery-exclude' ) === true ) { return false ; } } if ( isset ( $ addresses [ $ paymentType ] ) ) { $ code = strtoupper ( $ addresses [ $ paymentType ] -> getCountryId ( ) ) ; if ( $ this -> _checkCountryCode ( $ code , 'country.billing-include' ) === false || $ this -> _checkCountryCode ( $ code , 'country.billing-exclude' ) === true ) { return false ; } } return $ this -> _getProvider ( ) -> isAvailable ( $ basket ) ; }
Checks if the country code is allowed for the service provider.

@param MShop_Order_Item_Base_Interface $basket Basket object
@return boolean True if payment provider can be used, false if not
Checks if the country code is allowed for the service provider .