309 lines
16 KiB
PHP
Executable File
309 lines
16 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Etre admin
|
|
// -----------------------------------------------------
|
|
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']=='O' ) {
|
|
|
|
// -----------------------------------------------------
|
|
// Init
|
|
// -----------------------------------------------------
|
|
$theIdPaie=1;
|
|
$theIdCompte='';
|
|
$thePrivateKeyTest='';
|
|
$theLibClePriveTest='';
|
|
$thePublicKeyTest='';
|
|
$theLibelleClePubTest='';
|
|
$theLibelleClePriveProd='';
|
|
$thePrivateKeyProd='';
|
|
$theLibelleClePublicProd='';
|
|
$thePublicKeyProd='';
|
|
$theTypeCompte='';
|
|
$idCompteProd='';
|
|
$pwdCompteProd='';
|
|
$theEnv='';
|
|
$enable='';
|
|
|
|
// -----------------------------------------------------
|
|
// Post
|
|
// include ("./options/options.post.php");
|
|
include ("mp.post.php");
|
|
|
|
|
|
// -----------------------------------------------------
|
|
// Update
|
|
// -----------------------------------------------------
|
|
if ($codeOpe==='upMpConf') {include ("mp.reqUpConf.php"); }
|
|
else {
|
|
if (isset($debug[1]) && $debug[1] == '1' ) {$admMsg .= '<br>Pas de update mp.conf'; }
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Select
|
|
// -----------------------------------------------------
|
|
include ("mp.reqSelect.conf.php");
|
|
|
|
// -----------------------------------------------------
|
|
// Debug
|
|
// -----------------------------------------------------
|
|
if (isset($debug[1]) && $debug[1] == '1') {include ("mp.debug.php"); }
|
|
|
|
// -----------------------------------------------------
|
|
// Formulaire
|
|
// -----------------------------------------------------
|
|
echo '<form name="mpConf" id="mpConf" method="POST" >';
|
|
|
|
// -----------------------------------------------------
|
|
// Champs cachés
|
|
// -----------------------------------------------------
|
|
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" />';
|
|
echo '<input type="hidden" name="theIdPaie" id="theIdPaie" value="' .$theIdPaie. '" />';
|
|
|
|
echo '<div id="zoneFormModales" >';
|
|
|
|
// -----------------------------------------------------
|
|
// Zone aide
|
|
// echo '<div id="bandeauAideInfo" >';
|
|
echo '<span class="info-icon fad fa-info-circle" onMouseOver="openPopup(\'T\');" onMouseLeave="closePopup(\'T\');"></span>';
|
|
echo '<div id="popupInfoT" class="popup">';
|
|
echo '<div class="popup-content">';
|
|
echo '<span class="popup-close" onClick="closePopup(\'T\');">×</span>';
|
|
echo '<img src="./adminInclude/designAdmin/info.png" alt="Info" class="popup-icon" />';
|
|
|
|
// echo '<p>Veuillez cliquez sur un champ ou une zone différente, pour valider votre saisie.</p>';
|
|
// if ($_SESSION['isDemo']==1) echo '<br><br><p>Pas de modification pour la demo.<p>';
|
|
|
|
// back office paypal
|
|
if ($theIdPaie==4) {
|
|
echo 'Paypal';
|
|
}
|
|
|
|
// mango pay
|
|
if ($theIdPaie==5) {
|
|
// Pour memoire si market place : filtrer catalogue dans Back office sur mail vendeur ( table produit ), chaque vendeur ne voit que ses produits ?
|
|
// Pour memoire si market place : fait par mangopay : chaque vendeur doit avoir un rib / adresse differente
|
|
// Pour memoire si market place : chaque vendeur doit avoir les infos vendeur : reputation, site de reference...., nouvelle table a créer
|
|
// Pour memoire si market place : chaque vendeur doit avoir un compte admin ou un vendeur acces admin full et les autres restreints ??
|
|
echo 'mango pay';
|
|
}
|
|
|
|
// Stripe
|
|
if ($theIdPaie==6) {
|
|
echo 'Pour que le client puisse payer par carte bancaire avec stripe vous devez créer votre compte chez eux. Stripe reçoit le paiement pour vous et vous reverse les sommes par semaine ou par mois selon vos réglages. <br><br>Ils proposent 2 environnements : <br>- environnement de test <br>- environnement de production. <br><br>Pour chaque environnement stripe fourni une clé privée et une clé publique. Vous devez les copier dans votre gestionnaire (ici) pour les utiliser. <br><br>Stripe s\'occupe de la vérification de la carte bleue et de toute la chaîne de paiement, y compris les remboursements';
|
|
}
|
|
|
|
// payPlug
|
|
if ($theIdPaie==7) {
|
|
echo 'Pay Plug';
|
|
}
|
|
|
|
// Lyra
|
|
if ($theIdPaie==8) {
|
|
echo 'Lyra';
|
|
}
|
|
|
|
|
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
// echo '</div>';
|
|
|
|
|
|
// back office paypal
|
|
if ($theIdPaie==4) {
|
|
echo '<img width="18" src="./adminInclude/designAdmin/paypal.png" />';
|
|
echo '<a href="https://www.paypal.com/fr/webapps/mpp/account-selection" target="_blank">Créer un compte PayPal</a>    ';
|
|
echo '<i class="fad fa-key" style="color:blue; "></i>';
|
|
echo '<a href="https://developer.paypal.com/docs/business/" target="_blank">Accès au compte PayPal</a>  ';
|
|
echo '<i class="fad fa-file-alt" style="color:blue; "></i>';
|
|
echo '<a href="https://developer.paypal.com/developer/applications/" target="_blank">Documentation technique</a><br>';
|
|
}
|
|
|
|
// mango pay
|
|
if ($theIdPaie==5) {
|
|
// Pour memoire si market place : filtrer catalogue dans Back office sur mail vendeur ( table produit ), chaque vendeur ne voit que ses produits ?
|
|
// Pour memoire si market place : fait par mangopay : chaque vendeur doit avoir un rib / adresse differente
|
|
// Pour memoire si market place : chaque vendeur doit avoir les infos vendeur : reputation, site de reference...., nouvelle table a créer
|
|
// Pour memoire si market place : chaque vendeur doit avoir un compte admin ou un vendeur acces admin full et les autres restreints ??
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<img width="18" src="./adminInclude/designAdmin/mangoPay.png" /> ';
|
|
echo '<a href="https://mangopay.com/" target="_blank">Créer un compte MANGOPAY (toDo)</a>    ';
|
|
echo '</span>';
|
|
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<i class="fad fa-key" style="color:blue; "></i> ';
|
|
echo '<a href="https://hub.mangopay.com/api-keys" target="_blank">Accès au compte MANGOPAY</a><br>';
|
|
echo '</span>';
|
|
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<i class="fad fa-plus" style="color:blue; "></i> ';
|
|
echo '<span onClick="window.location=\'./mangPay.scripts/mangoPay.appel.php\'; ">Créer un revendeur (toDo)</span>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// Stripe
|
|
if ($theIdPaie==6) {
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<img width="18" src="./adminInclude/designAdmin/stripe.logo.jpg" /> ';
|
|
echo '<a href="https://dashboard.stripe.com/register" target="_blank">Créer un compte Stripe</a>    ';
|
|
echo '</span>';
|
|
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<i class="fad fa-key" style="color:blue; "></i> ';
|
|
echo '<a href="https://dashboard.stripe.com/dashboard" target="_blank">Accès à votre compte Stripe</a>  ';
|
|
echo '</span>';
|
|
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<i class="fad fa-file-alt" style="color:blue; "></i> ';
|
|
echo '<a href="https://stripe.com/docs/development" target="_blank">Documentation technique</a><br>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// payPlug
|
|
if ($theIdPaie==7) {
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<img width="18" src="./adminInclude/designAdmin/payPlug.jpg" /> ';
|
|
echo '<a href="https://www.payplug.com/fr/" target="_blank">Créer un compte payPlug</a> ';
|
|
echo '</span>';
|
|
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<i class="fad fa-key" style="color:blue; "></i> ';
|
|
echo '<a href="https://portal.payplug.com/#/configuration/payment-page" target="_blank">Accès au compte payPlug</a>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// Lyra
|
|
if ($theIdPaie==8) {
|
|
echo '<span class="boutonsWebmaster">';
|
|
echo '<img width="18" src="./adminInclude/designAdmin/logo_lyra_blue.svg" />';
|
|
echo '<a href="https://www.lyra.com/fr/" target="_blank">Créer un compte Lyra</a> ';
|
|
echo '</span>';
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Type compte : inutile ca alourdit
|
|
// -----------------------------------------------------
|
|
echo '<input type="hidden" class="inputWebmaster" id="theTypeCompte" name="theTypeCompte" style="width:40%; " value="' .$theTypeCompte. '" onChange="upMpConf(\'' .$enable. '\'); " >';
|
|
|
|
// -----------------------------------------------------
|
|
// Environnement test ou prod si pas cheque, pas virement bancaire
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie!=2 && $theIdPaie!=3) {
|
|
echo '<span class="libChampsWebmaster" style="padding:15px; width:100%; border:1px solid lightgrey">Environnement:<br> ';
|
|
if ($theEnv=='En Test') {
|
|
echo '<input type="radio" id="Test" name="theEnv" value="En Test" onChange="upMpConf(); " checked>';
|
|
echo '<label for="Test">En test ( données fictives )</label>';
|
|
|
|
echo '<br><input type="radio" id="Actif" name="theEnv" value="Activé" onChange="upMpConf(); " >';
|
|
echo '<label for="Actif">En production ( données réelles )</label>';
|
|
}
|
|
else {
|
|
echo '<input type="radio" id="Test" name="theEnv" value="En Test" onChange="upMpConf(); " >';
|
|
echo '<label for="Test">En test ( données fictives )</label>';
|
|
|
|
echo '<br><input type="radio" id="Actif" name="theEnv" value="Activé" onChange="upMpConf(); " checked>';
|
|
echo '<label for="Actif">En production ( données réelles )</label>';
|
|
}
|
|
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Identifiant/clé ( libellé jamais modifié ici mais en base )
|
|
// -----------------------------------------------------
|
|
if ($_SESSION['isDemo']==1) $enable='disabled'; else $enable='-';
|
|
if ($theIdPaie==4 || $theIdPaie==7) {
|
|
echo '<span class="libChampsWebmaster" style="width:100%; border:1px solid green; ">' .$theLibIdCompte. ' : ';
|
|
echo '<textArea class="inputWebmaster" id="theIdCompte" rows="3" cols="50" name="theIdCompte" style="width:100%; white-space: pre-wrap; height:100%; word-wrap:break-word; word-break: break-all; " value="' .$theIdCompte. '" onChange="upMpConf(\'' .$enable. '\'); " />' .$theIdCompte. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
// API URL TEST
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==5) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; width:100%; border:1px solid blue; ">URL API TEST (sand box) : ';
|
|
echo '<textArea class="inputWebmaster" id="theApiTest" rows="3" cols="50" name="theApiTest" style="width:100%; white-space: pre-wrap; height:100%; word-wrap:break-word; word-break: break-all; " value="' .$theApiTest. '" onChange="upMpConf(\'' .$enable. '\'); " />' .$theApiTest. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// clé priv Test ( libellé jamais modifié ici mais en base )
|
|
// -----------------------------------------------------
|
|
// que pour stripe - paypal - payPlug
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==4 || $theIdPaie==6 || $theIdPaie==7) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; align-items: flex-start; width:100%; border:1px solid blue; ">';
|
|
echo '<span><b>' .$theLibClePriveTest. ' :</b></span>';
|
|
echo '<textArea class="inputWebmaster" id="thePrivateKeyTest" rows="3" cols="50" name="thePrivateKeyTest" style="width:100%; white-space: pre-wrap; word-wrap:break-word; word-break: break-all; " value="' .$thePrivateKeyTest. '" onClick="admMsgClear(); " onChange="upMpConf(\'' .$enable. '\'); " />' .$thePrivateKeyTest. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// clé pub Test ( libellé jamais modifié ici mais en base )
|
|
// -----------------------------------------------------
|
|
// que pour stripe - paypal - payPlug
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==4 || $theIdPaie==6 || $theIdPaie==7) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; width:100%; border:1px solid blue; "><b>' .$theLibelleClePubTest. ' : </b>';
|
|
echo '<textArea class="inputWebmaster" id="thePublicKeyTest" rows="3" cols="50" name="thePublicKeyTest" style="width:100%; white-space: pre-wrap; word-wrap:break-word; word-break: break-all; " value="' .$thePublicKeyTest. '" onClick="admMsgClear(); " onChange="upMpConf(\'' .$enable. '\'); " />' .$thePublicKeyTest. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
// API URL PROD
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==5) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; width:100%; border:1px solid red; ">URL API PRODUCTION : ';
|
|
echo '<textArea class="inputWebmaster" id="theApiProd" rows="3" cols="50" name="theApiProd" style="width:100%; white-space: pre-wrap; word-wrap:break-word; word-break: break-all; " value="' .$theApiProd. '" onClick="admMsgClear(); " onChange="upMpConf(\'' .$enable. '\'); " />' .$theApiProd. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// clé private Prod ( libellé jamais modifié ici mais en base )
|
|
// que pour paypal - stripe - payPlug
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==4 || $theIdPaie==6 || $theIdPaie==7) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; width:100%; border:1px solid red; "><b>' .$theLibelleClePriveProd. ' :</b>';
|
|
echo '<textArea class="inputWebmaster" id="thePrivateKeyProd" rows="3" cols="50" name="thePrivateKeyProd" style="width:100%; white-space: pre-wrap; word-wrap:break-word; word-break: break-all; " value="' .$thePrivateKeyProd. '" onClick="admMsgClear(); " onChange="upMpConf(\'' .$enable. '\'); " />' .$thePrivateKeyProd. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// clé pub Prod ( libellé jamais modifié ici mais en base )
|
|
// -----------------------------------------------------
|
|
// que pour stripe
|
|
// -----------------------------------------------------
|
|
if ($theIdPaie==4 || $theIdPaie==6 || $theIdPaie==7) {
|
|
echo '<span class="libChampsWebmaster" style="flex-direction: column; text-align:left; margin:10px; align-items: flex-start; width:100%; border:1px solid red; "><b>' .$theLibelleClePublicProd. ' :</b>';
|
|
echo '<textArea class="inputWebmaster" id="thePublicKeyProd" rows="3" cols="50" name="thePublicKeyProd" style="width:100%; white-space: pre-wrap; word-wrap:break-word; word-break: break-all; " value="' .$thePublicKeyProd. '" onChange="upMpConf(\'' .$enable. '\'); " />' .$thePublicKeyProd. '</textarea>';
|
|
echo '</span>';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Retour
|
|
// -----------------------------------------------------
|
|
echo '          ';
|
|
echo '<span class="boutonsWebmaster" onClick="document.getElementById(\'modaleGene\').style.display=\'none\'; " >';
|
|
echo '<i class="fad fa-chevron-circle-left" style="color:white; "></i>  ';
|
|
echo '  <a href="./frmAdmin.php?affAdmin=6&optAff=1" >';
|
|
echo 'Retour';
|
|
echo '</a><br>';
|
|
echo '</span>';
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
|
|
|
}
|
|
else {
|
|
$confPath="../../_conf";
|
|
include ("./adminInclude/redirectionAdmin.php");
|
|
}
|
|
?>
|