From 0374477e8892490d162f1f3dc58e3047f063ab1f Mon Sep 17 00:00:00 2001 From: Sebastien BEAUGRAND Date: Fri, 8 Oct 2010 12:31:59 +0000 Subject: [PATCH] giant: formR[pays] = CountryCode --- batch/giant.php | 2 +- includes/giant/client.php | 20 +++----------------- includes/recherche/recherche_ent.php | 8 ++++---- includes/recherche/recherche_list.php | 2 +- www/pages/giant_enquete.php | 8 ++++---- 5 files changed, 13 insertions(+), 27 deletions(-) diff --git a/batch/giant.php b/batch/giant.php index a114391f0..6495677c4 100644 --- a/batch/giant.php +++ b/batch/giant.php @@ -40,7 +40,7 @@ foreach ($commandes as $c) { ->where('OrderId = ?', $c['OrderId']) ->fetchOne(); - $soap_client = getClient($pays, 'credit-data'); + $soap_client = getClient($q->CountryCode, 'credit-data'); $o = new StdClass; $o->ProviderOrderId = $q->ProviderOrderId; diff --git a/includes/giant/client.php b/includes/giant/client.php index 59d6207f3..9dcfc3037 100644 --- a/includes/giant/client.php +++ b/includes/giant/client.php @@ -5,22 +5,8 @@ function getProviderId($pays) { switch ($pays) { - case 1: return '001'; - case 2: return '003'; - default: - print 'Erreur sur le pays'; - exit; - } -} - -// --------------------------------------------------------------------------- // -// getCountryCode -// --------------------------------------------------------------------------- // -function getCountryCode($pays) -{ - switch ($pays) { - case 1: return 'BE'; - case 2: return 'NL'; + case 'BE': return '001'; + case 'NL': return '003'; default: print 'Erreur sur le pays'; exit; @@ -35,8 +21,8 @@ function getClient($pays, $service) $service_header = new StdClass; $service_header->ConsumerId = '006'; $service_header->Provider = new StdClass; + $service_header->Provider->CountryCode = $pays; $service_header->Provider->ProviderId = getProviderId($pays); - $service_header->Provider->CountryCode = getCountryCode($pays); $service_header->TimeStamp = date('Y-m-d\TH:i:s'); $service_header->TestIndication = true; diff --git a/includes/recherche/recherche_ent.php b/includes/recherche/recherche_ent.php index b4cefd3fa..52b83b34d 100644 --- a/includes/recherche/recherche_ent.php +++ b/includes/recherche/recherche_ent.php @@ -57,12 +57,12 @@ foreach (array('siret', 'France', + 'BE' => 'Belgique', + 'NL' => 'Pays bas'); print '
'; print ''; print '