示例#1
0
 /**
  * To check billing country is allowed for the payment method
  *
  * @param string $country
  * @return bool
  */
 public function canUseForCountry($country)
 {
     /*
     for specific country, the flag will set up as 1
     */
     if ($this->getConfigData(self::KEY_ALLOW_SPECIFIC) == 1) {
         $availableCountries = explode(',', $this->getConfigData(self::KEY_SPECIFIC_COUNTRY));
         if (!in_array($country, $availableCountries)) {
             return false;
         }
     } elseif ($this->sourceCountry->isCountryRestricted($country)) {
         return false;
     }
     return true;
 }