We do payment in a web app by PayPal with checkout.js . Everything works fine if we execute the payment with the intent : "sale". But now we want to authorize the payment with checkout.js at the frontend and capture later at the backend with PayPal REST API. When we set the payment with intent : "authorize" we get response, but there is no authorisation ID we need for capture later. The related_recources array is empty. Can anybody tell me what is going wrong here? Tested with sandbox & production mode. Thanks in advance. paypal.Button.render({
env: 'sandbox',
client: {
sandbox: xxxxxxxxx
},
payment: function() {
var env = this.props.env;
var client = this.props.client;
return paypal.rest.payment.create(env, client, {
intent: "authorize",
transactions: [
{
amount: { total: totalEur, currency: "EUR" },
description: "Reservation..."
}
]
});
},
commit: true,
onAuthorize: function(data, actions) {
actions.payment.get().then(function(pdata) {
console.dir(pdata);
...
... View more