<!-- Div contenant le bouton Paypal  -->
<div id="paypal-button-container"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
// Rendu du bouton PayPal
paypal.Button.render({
// Mise en place de votre environment
env: 'sandbox', // sandbox | production

// Specification du style du bouton
style: {
  layout: 'vertical',  // horizontal | vertical
  size:   'medium',    // medium | large | responsive
  shape:  'rect',      // pill | rect
  color:  'gold'       // gold | blue | silver | white | black
},

// Spécification des sources de financement autorisés ou pas
//
// Options:
// - paypal.FUNDING.CARD
// - paypal.FUNDING.CREDIT
// - paypal.FUNDING.ELV
funding: {
  allowed: [
    paypal.FUNDING.CARD,
    paypal.FUNDING.CREDIT
  ],
  disallowed: []
},

// Activer le paiement instantané (optionnel)
commit: true,

// PayPal Client IDs - remplacer par la votre
// Créer une application PayPal: https://developer.paypal.com/developer/applications/create
client: {	
  sandbox: 'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R',
  production: '<insertion production client id>'

},

payment: function (data, actions) {
  return actions.payment.create({
    payment: {
      transactions: [
        {
          amount: {
            total: '0.01', //somme à payer
			// <?php $montant=0.01; echo $montant; ?> à la place de 0.01
            currency: 'EUR'  //devise
          }
        }
      ]
    }
  });
},

onAuthorize: function (data, actions) {
  return actions.payment.execute()
    .then(function () {
	//action si paiement terminé	
      window.alert('Paiement terminé!');
    });
}
}, '#paypal-button-container');
</script>