From 2504a3481829254fb57f85e5089598e7a6a7fa34 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 26 Jun 2014 19:13:40 -0400 Subject: [PATCH] Fallback to letting VAT validate if the VIES service is down --- .../application/controllers/BillingController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/controllers/BillingController.php b/airtime_mvc/application/controllers/BillingController.php index 883a7e831..4f967264a 100644 --- a/airtime_mvc/application/controllers/BillingController.php +++ b/airtime_mvc/application/controllers/BillingController.php @@ -215,12 +215,19 @@ class BillingController extends Zend_Controller_Action { } } catch(SoapFault $e) { Logging::error('VIES EU VAT validation error: '.$e->faultstring); - return false; + if ($e->faultstring == "INVALID_INPUT") { + return false; + } + //If there was another error with the VAT validation service, we allow + //the VAT number to pass. (eg. SERVER_BUSY, MS_UNAVAILABLE, TIMEOUT, SERVICE_UNAVAILABLE) + return true; } } else { // Connection to host not possible, europe.eu down? Logging::error('VIES EU VAT validation error: Host unreachable'); - return false; + //If there was an error with the VAT validation service, we allow + //the VAT number to pass. + return true; } return false; }