Correction typo + valeur pays pour la méthode getIdentite

This commit is contained in:
Michael RICOIS 2009-09-25 10:21:41 +00:00
parent 6d1fef51ab
commit db2a0d9be0

View File

@ -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;