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 "
| ip client | Num. transaction | Date | heure | "; +print "Réf. commande | "; +print "ip client | Num. transaction | Date | Heure | "; print "Num autorisation | "; print "clé acceptation | "; print "code retour | "; -print "Réf. commande | "; print "
| '.$objp->ref_commande.' | '; + } + print "$objp->ipclient | "; print "$objp->num_transaction | "; print "$objp->date_transaction | "; @@ -74,7 +83,7 @@ if ($result) { print "$objp->num_autorisation | "; print "$objp->cle_acceptation | "; print "$objp->code_retour | "; - print "$objp->ref_commande | "; + $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 "