diff --git a/htdocs/compta/bank/bplc.php b/htdocs/compta/bank/bplc.php index f9080d20f93..252c0eae5b1 100644 --- a/htdocs/compta/bank/bplc.php +++ b/htdocs/compta/bank/bplc.php @@ -33,15 +33,15 @@ $pageprev = $page - 1; $pagenext = $page + 1; -print_barre_titre("Transactions BPLC", $page, $PHP_SELF); +print_barre_liste("Transactions BPLC", $page, $PHP_SELF); print ""; print ""; -print ""; +print ""; +print ""; print ""; print ""; print ""; -print ""; print "\n"; $sql = "SELECT ipclient, @@ -67,6 +67,15 @@ if ($result) { $objp = $db->fetch_object( $i); print ""; + + $type = substr($objp->ref_commande, strlen($objp->ref_commande) - 2 ); + $id = substr($objp->ref_commande, 0 , strlen($objp->ref_commande) - 2 ); + + if ($type == 10) + { + print ''; + } + print ""; print ""; print ""; @@ -74,7 +83,7 @@ if ($result) { print ""; print ""; print ""; - print ""; + $i++; diff --git a/htdocs/public/dons/bplc.php b/htdocs/public/dons/bplc.php index 78f19ab371a..55c551220a8 100644 --- a/htdocs/public/dons/bplc.php +++ b/htdocs/public/dons/bplc.php @@ -20,15 +20,21 @@ * */ +/* + * Gestion du retour du système de Cyberpaiement + * + */ + require("../../lib/mysql.lib.php3"); require("../../conf/conf.class.php3"); require("../../retourbplc.class.php"); +require("../../don.class.php"); $conf = new Conf(); $db = new Db(); -$retbplc = new Retourbplc($db, $conf); +$retbplc = new Retourbplc($db); $retbplc->num_compte = $conf->bplc->num_compte; @@ -45,6 +51,24 @@ $retbplc->code_retour = $CHAMP906; $retbplc->ref_commande = $CHAMP200; -print $retbplc->insertdb(); +/* + * Insertion de la transaction dans la base + */ + +$return = $retbplc->insertdb(); + +if($return) +{ + if ($retbplc->check_key($retbplc->cle_acceptation)) + { + /* + * Validation de la commande + * + */ + + $don = new Don($db); + } + +} diff --git a/htdocs/retourbplc.class.php b/htdocs/retourbplc.class.php index cc97b880fc9..93e745adba3 100644 --- a/htdocs/retourbplc.class.php +++ b/htdocs/retourbplc.class.php @@ -18,11 +18,15 @@ * $Id$ * $Source$ * + * Classe de gestion du retour RSTS du systeme de paiement en ligne + * CyberPaiement (TM) de la Banque Populaire de Lorraine + * + * + * */ class Retourbplc { - var $conf; var $db; var $ipclient; @@ -41,23 +45,21 @@ class Retourbplc /* * Initialisation des valeurs par défaut */ - Function Retourbplc($db, $conf) + Function Retourbplc($db) { $this->db = $db; } /* - * + * Insertion dans la base de donnée de la transaction * * */ Function insertdb() { - if ($this->check_key($this->cle_acceptation)) - { - $sql = "INSERT INTO transaction_bplc"; - $sql .= " (ipclient, + $sql = "INSERT INTO transaction_bplc"; + $sql .= " (ipclient, num_transaction, date_transaction, heure_transaction, @@ -66,31 +68,30 @@ class Retourbplc code_retour, ref_commande)"; - $sql .= " VALUES ('$this->ipclient', - '$this->num_transaction', - '$this->date_transaction', - '$this->heure_transaction', - '$this->num_autorisation', - '$this->cle_acceptation', - '$this->code_retour', - '$this->ref_commande')"; + $sql .= " VALUES ('$this->ipclient', + '$this->num_transaction', + '$this->date_transaction', + '$this->heure_transaction', + '$this->num_autorisation', + '$this->cle_acceptation', + '$this->code_retour', + $this->ref_commande)"; - $result = $this->db->query($sql); - - if ($result) - { - return 1; - } - else - { - print $this->db->error(); - print "


$sql

"; - return 0; - } - } + $result = $this->db->query($sql); + + if ($result) + { + return $this->db->last_insertid(); + } + else + { + print $this->db->error(); + print "


$sql

"; + return 0; + } } /* - * + * Verification de la validitée de la clé * * */
ip clientNum. transactionDateheureRéf. commandeip clientNum. transactionDateHeureNum autorisationclé acceptationcode retourRéf. commande
'.$objp->ref_commande.'$objp->ipclient$objp->num_transaction$objp->date_transaction$objp->num_autorisation$objp->cle_acceptation$objp->code_retour$objp->ref_commande