config = $config; } /** * Determine if an Order can be serviced by Vertex * * @param Order $order * @return bool */ public function isOrderServiceableByVertex(Order $order) { if ($order->getIsVirtual() || !$order->getShippingAddress()) { $address = $order->getBillingAddress(); } else { $address = $order->getShippingAddress(); } return $address && $this->isCountryIdServiceableByVertex($address->getCountryId()); } /** * Determine if a country can be serviced by Vertex * * @param string $countryId * @return bool */ public function isCountryIdServiceableByVertex($countryId) { return in_array($countryId, $this->config->getAllowedCountries(), false); } }