/ / Comment configurer IPN pour PayPal Express Checkout? - javascript, php, paypal

Comment configurer IPN pour PayPal Express Checkout? - javascript, php, paypal

J'aimerais utiliser PayPal Express Checkout et utiliser l'exemple client officiel de PayPal.

https://developer.paypal.com/demo/checkout/#/pattern/client

<script src="https://www.paypalobjects.com/api/checkout.js"></script>

<div id="paypal-button-container"></div>

<script>

// Render the PayPal button

paypal.Button.render({
x
// Set your environment

env: "sandbox", // sandbox | production

// PayPal Client IDs - replace with your own
// Create a PayPal app: https://developer.paypal.com/developer/applications/create

client: {
sandbox:    "AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R",
production: "<insert production client id>"
},

// Set to "Pay Now"

commit: true,

// Wait for the PayPal button to be clicked

payment: function(actions) {

// Make a client-side call to the REST api to create the payment

return actions.payment.create({
transactions: [
{
amount: { total: "0.01", currency: "USD" }
}
]
});
},

// Wait for the payment to be authorized by the customer

onAuthorize: function(data, actions) {

// Execute the payment

return actions.payment.execute().then(function() {
window.alert("Payment Complete!");
});
}

}, "#paypal-button-container");

</script>

Ma question est la suivante: comment puis-je passer le notifiy_url pour obtenir la confirmation de paiement et les données du client?

Je suppose que la fonction onAuthorize n’est pas suffisante. Si quelqu'un peut clarifier, j'apprécierai.

Merci pour l'aide!

Réponses:

2 pour la réponse № 1

Avec les API REST, vous devez utiliser Webhooks, pas IPN. IPN est destiné aux API classiques.