Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) Octolys Development */
/* email : thelia@octolys.fr */
/* web : http://www.octolys.fr */
/* */
/* 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 */
/* */
/*************************************************************************************/
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../classes/PluginsPaiements.class.php");
class Paypal2 extends PluginsPaiements{
function init(){
$paypal2 = new Variable();
if(! $paypal2->charger("paypal2")){
$paypal2->nom = "paypal2";
$paypal2->valeur = "";
$paypal2->add();
}
$devise_paypal2 = new Variable();
if(! $devise_paypal2->charger("devise_paypal2")){
$devise_paypal2->nom = "devise_paypal2";
$devise_paypal2->valeur = "";
$devise_paypal2->add();
}
$code_langue_paypal2 = new Variable();
if(! $code_langue_paypal2->charger("code_langue_paypal2")){
$code_langue_paypal2->nom = "code_langue_paypal2";
$code_langue_paypal2->valeur = "";
$code_langue_paypal2->add();
}
$serveur2 = new Variable();
if(! $serveur2->charger("serveur2")){
$serveur2->nom = "serveur2";
$serveur2->valeur = "";
$serveur2->add();
}
$this->ajout_desc("Paypal", "Paypal", "", 1);
}
function destroy(){
}
function Paypal2(){
$this->PluginsPaiements("Paypal2");
}
function paiement($commande){
header("Location: " . "client/plugins/paypal2/paiement2.php");
}
}
?>

View File

@@ -0,0 +1,33 @@
/*-----------------------------------------------------------------------------------*/
/* Copyright (c) BELKACEM Karim */
/* email : karim@ergonomind.com */
/* web : http://www.ergonomind.com */
/*-----------------------------------------------------------------------------------*/
/* 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 */
/* */
/*************************************************************************************/
Ce plugin est une version améliorée du plugin Paypal de Yoan Plugin Paypal originale version yoan, Pour lutilisation, cest simple il suffit dinstaller le plugin comme habituellement dans Thelia, son originalité est que lon gère et paramètre le mail du compte paypal, la devise de la monnaie et la langue de la devise via ladmin dans Configuration / Gestion des variables de votre administration thelia. 4 nouveaux champs sont crées :
- paypal2 (votre mail du compte paypal),
- devise_paypal2 (la devise de la monnaie, exemple EUR),
- code_langue_paypal2 (la langue de la devise, exemple FR).
- serveur2 (serveur de connexion Paypal, par exemple).
Mode Sandbox pour les tests = https://www.sandbox.paypal.com/cgi-bin/webscr
Mode Live pour la production = https://www.paypal.com/cgi-bin/webscr
- Page de redirection vers Paypal à été personnalisation pour mieux comprendre la redirection vers la page de paiment et faire patienter l'internaute
ATTENTION : désactiver le plugin Paypal installé en standard avant dactiver le plugin Paypal2 !

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,46 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Variable.class.php");
$titre1="Paypal";
$chapo1="Carte bancaire";
$description1="";
$titre2="";
$chapo2="";
$description2="";
$titre3="";
$chapo3="";
$description3="";
$paypal2 = new Variable();
$paypal2->charger("paypal2");
$compte_paypal = "$paypal2->valeur";
$devise_paypal2 = new Variable();
$devise_paypal2->charger("devise_paypal2");
$Devise = "$devise_paypal2->valeur";
//$Devise = "EUR";
$code_langue_paypal2 = new Variable();
$code_langue_paypal2->charger("code_langue_paypal2");
$Code_Langue = "$code_langue_paypal2->valeur";
//$Code_Langue = "FR";
$serveur2 = new Variable();
$serveur2->charger("serveur2");
$Serveur = "$serveur2->valeur";
// Mode sandbox $Serveur = "https://www.sandbox.paypal.com/cgi-bin/webscr";
//$Serveur = "https://www.paypal.com/cgi-bin/webscr";
$urlsite = new Variable();
$urlsite->charger("urlsite");
$serveur = $Serveur;
$confirm = $urlsite->valeur."/client/plugins/paypal2/confirmation2.php";
$retourok = $urlsite->valeur."?fond=merci";
$retournok = $urlsite->valeur."?fond=regret";
?>

View File

@@ -0,0 +1,54 @@
<?php
include_once("config2.php");
include_once("../../../classes/Commande.class.php");
include_once("../../../fonctions/divers.php");
$chaine = '';
$reponse = '';
$donnees = '';
$url = parse_url($serveur);
foreach ($_POST as $champs=>$valeur) {
$donnes["$champs"] = $valeur;
$chaine .= $champs.'='.urlencode(stripslashes($valeur)).'&';
}
$chaine.="cmd=_notify-validate";
// open the connection to paypal
$fp = fsockopen($url['host'],"80",$err_num,$err_str,30);
if(!$fp) {
return false;
} else {
fputs($fp, "POST $url[path] HTTP/1.1\r\n");
fputs($fp, "Host: $url[host]\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ".strlen($chaine)."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $chaine . "\r\n\r\n");
while(!feof($fp))
$reponse .= fgets($fp, 1024);
fclose($fp);
}
if(strstr($reponse, "VERIFIED")){
$reference = $_POST['invoice'];
$commande = new Commande();
$commande->charger_trans($reference);
$commande->statut = 2;
$commande->genfact();
$commande->maj();
modules_fonction("confirmation", $commande);
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,150 @@
<?php
/*****************************************************************************
*
* Auteur : Bruno | atnos.com (contact: contact@atnos.com)
* Version : 0.1
* Date : 29/07/2007
*
* Copyright (C) 2007 Bruno PERLES
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*****************************************************************************/
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Navigation.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/config2.php");
session_start();
$total = 0;
$total = $_SESSION['navig']->commande->total;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Paiement Paypal</title>
<style type="text/css">
/* CSS issu des tutoriels www.alsacreations.com/articles */
body {
margin: 0;
padding: 0;
background-color: #eee;
}
#global {
position:absolute;
left: 50%;
top: 50%;
width: 400px;
height: 150px;
margin-top: -75px; /* moitié de la hauteur */
margin-left: -200px; /* moitié de la largeur */
background-color: transparent;
text-align: center;
}
#global span {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}
</style>
<body onLoad="document.getElementById('formpaypal').submit()">
<?php
// R?f?rence
$Reference_Cde = urlencode($_SESSION['navig']->commande->transaction);
// Montant
$Montant = $total;
?>
<div id="global">
<img src="cc_paypal/pp_secure_213wx37h.gif" alt="" /><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><img src="cc_paypal/logo_ccAmex.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccAurora_37wx23h.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccCB_37wx23h.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccCofidis_37wx23h.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccCofinoga_22wx23h.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccMC.gif" alt="" /></td>
<td><img src="cc_paypal/logo_ccVisa.gif" alt="" /></td>
<td><img src="cc_paypal/PayPal_mark_37x23.gif" alt="" /></td>
<td><img src="cc_paypal/logo_VIPwhite_66x27.gif" alt="" /></td>
</tr>
</table> <br />
<span>Merci de votre commande, vous allez &ecirc;tre redirig&eacute; vers la page de paiement s&eacute;curis&eacute; Paypal, <strong>veuillez patienter...</strong></span>
</div>
<form action="<?php echo $serveur; ?>" id="formpaypal" method="post">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="first_name" value="<?php echo $_SESSION["navig"]->client->prenom; ?>" />
<input type="hidden" name="last_name" value="<?php echo $_SESSION["navig"]->client->nom; ?>" />
<input type="hidden" name="address1" value="<?php echo $_SESSION["navig"]->client->adresse1; ?>" />
<?php
if($_SESSION["navig"]->client->adresse2 != ""){
?>
<input type="hidden" name="address2" value="<?php echo $_SESSION["navig"]->client->adresse2; ?>" />
<?php
}
?>
<input type="hidden" name="city" value="<?php echo $_SESSION["navig"]->client->ville; ?>" />
<input type="hidden" name="zip" value="<?php echo $_SESSION["navig"]->client->cpostal; ?>" />
<input type="hidden" name="amount" value="<?php echo round($Montant, 2); ?>" />
<input type="hidden" name="email" value="<?php echo $_SESSION["navig"]->client->email; ?>">
<input type="hidden" name="shipping_1" value="<?php echo $_SESSION["navig"]->commande->port; ?>" />
<input type="hidden" name="discount_amount_cart" value="<?php echo round($_SESSION["navig"]->commande->codereduction, 2); ?>" />
<?php
$venteprod = new Venteprod();
$query = "select * from $venteprod->table where commande=".$_SESSION["navig"]->commande->id;
$resul = mysql_query($query);
$i=0;
while($row = mysql_fetch_object($resul)){
$i++;
?>
<input type="hidden" name="item_name_<?php echo($i); ?>" value="<?php echo trim($row->titre); ?>" />
<input type="hidden" name="amount_<?php echo($i); ?>" value="<?php echo $row->prixu; ?>" />
<input type="hidden" name="quantity_<?php echo($i); ?>" value="<?php echo $row->quantite; ?>" />
<?php
}
?>
<input type="hidden" name="business" value="<?php echo $compte_paypal; ?>" />
<input type="hidden" name="receiver_email" value="<?php echo $compte_paypal; ?>" />
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="currency_code" value="<?php echo $Devise; ?>" />
<input type="hidden" name="payer_id" value="<?php echo $_SESSION["navig"]->client->id; ?>" />
<input type="hidden" name="payer_email" value="<?php echo $_SESSION["navig"]->client->email; ?>" />
<input type="hidden" name="return" value="<?php echo $retourok; ?>" />
<input type="hidden" name="notify_url" value="<?php echo $confirm; ?>" />
<input type="hidden" name="cancel_return" value="<?php echo $retournok; ?>" />
<input type="hidden" name="invoice" value="<?php echo $Reference_Cde; ?>" />
</form>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Migration automatique depuis le fichier original, sauvegardé dans plugin.xml.save-->
<plugin>
<descriptif lang="fr">
<titre>Paypal2</titre>
<chapo></chapo>
<description>Ce plugin est une version améliorée du plugin Paypal de Yoan Plugin Paypal originale</description>
<postscriptum></postscriptum>
</descriptif>
<version>2.3</version>
<auteur>
<nom>Karim Belkacem - ergonomind@gmail.com</nom>
<societe></societe>
<email></email>
<web></web>
</auteur>
<type>paiement</type>
<prerequis/>
<thelia>1.5</thelia>
<etat>production</etat>
<documentation>Readme.txt</documentation>
<urlmiseajour></urlmiseajour>
</plugin>