dolibarr/htdocs/public/dons/bplc.php

88 lines
2.2 KiB
PHP
Raw Normal View History

2002-12-22 03:17:25 +01:00
<?PHP
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2002-12-22 03:17:25 +01:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
2002-12-28 15:57:29 +01:00
/*
* Gestion du retour du syst<EFBFBD>me de Cyberpaiement
* Cette page est appell<EFBFBD>e par le serveur de la BPLC lors de l'utilisation
* su syst<EFBFBD>me RSTS
2002-12-28 15:57:29 +01:00
*
*/
2002-12-22 03:17:25 +01:00
require("../../lib/mysql.lib.php3");
require("../../conf/conf.class.php3");
require("../../retourbplc.class.php");
2002-12-28 15:57:29 +01:00
require("../../don.class.php");
2002-12-22 03:17:25 +01:00
2002-12-23 17:15:48 +01:00
$conf = new Conf();
2002-12-22 03:17:25 +01:00
2002-12-22 03:28:51 +01:00
$db = new Db();
2002-12-22 03:17:25 +01:00
2002-12-28 15:57:29 +01:00
$retbplc = new Retourbplc($db);
2002-12-22 03:17:25 +01:00
2002-12-23 22:53:18 +01:00
$retbplc->num_compte = $conf->bplc->num_compte;
$retbplc->montant = $CHAMP201;
$retbplc->num_contrat = $CHAMP002;
$retbplc->ref_commande = $CHAMP200;
2002-12-23 17:15:48 +01:00
$retbplc->ipclient = $CHAMP105;
$retbplc->num_transaction = $CHAMP901;
$retbplc->date_transaction = $CHAMP902;
$retbplc->heure_transaction = $CHAMP903;
$retbplc->num_autorisation = $CHAMP904;
$retbplc->cle_acceptation = $CHAMP905;
$retbplc->code_retour = $CHAMP906;
2002-12-22 03:17:25 +01:00
2002-12-23 17:15:48 +01:00
$retbplc->ref_commande = $CHAMP200;
2002-12-22 03:28:51 +01:00
2002-12-28 15:57:29 +01:00
/*
* Insertion de la transaction dans la base
*/
$return = $retbplc->insertdb();
$don_id = substr($retbplc->ref_commande, 0, strlen($retbplc->ref_commande) -2);
print $don_id;
2002-12-28 15:57:29 +01:00
if($return)
{
if ($retbplc->check_key($retbplc->cle_acceptation))
{
2002-12-22 03:17:25 +01:00
2002-12-28 15:57:29 +01:00
/*
* Validation de la commande
*
*/
$don = new Don($db);
$don_id = strstr($retbplc->ref_commande, 0, strlen($retbplc->ref_commande) -2);
// 5 correspond au paiement en ligne voir table c_paiement
$don->set_paye($don_id, 5);
2002-12-28 15:57:29 +01:00
}
2002-12-22 03:17:25 +01:00
2002-12-28 15:57:29 +01:00
}