diff --git a/includes/graydon/wsfunctions.php b/includes/graydon/wsfunctions.php index 898e7bfbc..8c9f98152 100644 --- a/includes/graydon/wsfunctions.php +++ b/includes/graydon/wsfunctions.php @@ -416,14 +416,15 @@ function getCompanyMatchMethods($pays){ } -function getIdentite($companyProductIdentifier, $file){ - global $page, $mode, $firephp, $graydon, $authentication; +function getIdentite($CompanyProductIdentifier, $file){ + global $page, $mode, $firephp, $graydon, $authentication, $pays; $request = new StdClass(); $request->Authentication_Parameters = $authentication; $request->OrderCreatorEmail = 'mricois@scores-decisions.com'; $request->CompanyProductIdentifier = $CompanyProductIdentifier; $request->PartnerData = ''; + $firephp->log($request, 'request'); try { $placeOrderResult = $graydon->placeOrder($request); @@ -442,15 +443,29 @@ function getIdentite($companyProductIdentifier, $file){ $log->sessionID = $sessionID; $log->mode = $mode; $log->save(); - + $firephp->log($pays,'pays'); //Optention du prix du service - $prix = Doctrine_Query::create($conn) + $prix = Doctrine_Query::create() ->select('p.immediate') ->from('Price p') ->leftJoin('p.Country c') ->where('c.graydon_country = ?', $pays) ->fetchOne(); - + $firephp->log($prix,'prix'); + + $q = Doctrine_Query::create() + ->select('p.immediate') + ->from('Price p') + ->leftJoin('p.Country c') + ->where('c.graydon_country = ?', $pays); + $firephp->log($q->getSql(),'SQL'); + + $country = Doctrine_Query::create() + ->from('Country') + ->where('graydon_country = ?', $pays) + ->fetchOne(); + $firephp->log($country,'pays'); + //Enregistrement des commandes dans la bdd $commandes = new Commandes(); $commandes->reference = $placeOrderResult->OrderStatus->OrderReference; @@ -465,14 +480,7 @@ function getIdentite($companyProductIdentifier, $file){ $commandes->transactionidentifier = $transactionIdentifier; $commandes->user = $_SESSION['tabInfo']['login']; $commandes->mode = $_SESSION['graydon']['mode']; - - $country = Doctrine_Query::create() - ->from('Country') - ->where('graydon_country = ?', $pays) - ->fetchOne(); - $commandes->Country = $country; - $commandes->save(); $firephp->log($commandes->toArray(),'dataCommandes'); $commandes_id = $commandes->id;