alpha_full/pages/panier/paypal/modePaie.formPaypal.php
2026-04-06 22:58:51 +02:00

62 lines
2.7 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// Create a PHP project in your directory, then run the following command to install the PayPal JavaScript SDK.
// Linux ==> composer require paypal/paypal-checkout-sdk 1.0.1 Necessaire ? a tester
// acheteur de test : support@123ventes.com/loulou123
include ("reqSelectPaypal.php");
// ---------------------------------------------------
// Paypal si modePaie=4
// ---------------------------------------------------
echo '<span style="text-align:center;margin:auto;margin-top:10px;" align="center" >';
echo '<div id="smart-button-container" align="center" style="text-align: center;" >';
echo '<div style="text-align: center;" >';
echo '<div id="paypal-button-container" style="width:55%;"></div>';
// ---------------------------------------------------
// PREPARE
// ---------------------------------------------------
$totalTtcCde=str_replace(",", ".", $totalTtcCde);
echo '<input type="hidden" value="' .$totalTtcCde. '" id="totalTtcCde" >';
if ($lg=='')$lg='FRA';
if ($lg=='FRA') $locale='fr_FR';
if ($lg=='ENG') $locale='us_US';
if ($lg=='ITA') $locale='it_IT';
if ($lg=='ESP') $locale='es_ESP';
if ($lg=='DEU') $locale='de_DE';
$return_url= 'https://' .$server. '/recap-paiement-faireMajRecap-1';
$cancel_url= 'https://' .$server. '/recap-paiement-faireMajRecap-1';
echo '<input type="hidden" value="' .$return_url. '" id="return_url" >';
echo '<input type="hidden" value="' .$cancel_url. '" id="cancel_url" >';
// ---------------------------------------------------
// Bouton
// ---------------------------------------------------
//
if ($codeOpe==="upCommentaire") {
$paypalDebug=true;
$paypalCommit=true;
$paypalMerchant_id='';
$paypalSrc='https://www.paypal.com/sdk/js?client-id=' .$idPaypal. '&currency=EUR&locale=' .$locale. '"&commit=' .$paypalCommit. '&debug=' .$paypalDebug;
echo '<script src="' .$paypalSrc. '" data-sdk-integration-source="button-factory" data-amount="' .$totalTtcCde. '" >';
echo '</script>';
// if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .='' .$paypalSrc. ' data-sdk-integration-source="button-factory" data-amount="' .$totalTtcCde. '"';
}
else {
dynamiqItemImage (0, 0, 'boutons', 'span', 'onClick="upCommentaire();"', 'bouton', 5, 'icones', '-textClass-','margin:auto; max-width:29%; margin-bottom:10px;');
echo '<br><br>';
}
// ---------------------------------------------------
// APPEL
// ---------------------------------------------------
include ("modePaie.formPaypal.appel.js");
echo '</div>';
echo '</div>';
echo '</span>';
?>