- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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); ...
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you get in the response the "Response payload" returned after a successful call with either the PayPal authorization ID or the pay key to process via REST (PAY-XXXXXXXXXX). Or once the authorization is processed you then can log-in into your PayPal profile and capture the payment from there.
If you open the developer tool/console (F12) just before you click the payment button then check into the Network tab and you will find the Response Payload in the response area, attached image. This is returned in the response so you can use the response payload.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you get in the response the "Response payload" returned after a successful call with either the PayPal authorization ID or the pay key to process via REST (PAY-XXXXXXXXXX). Or once the authorization is processed you then can log-in into your PayPal profile and capture the payment from there.
If you open the developer tool/console (F12) just before you click the payment button then check into the Network tab and you will find the Response Payload in the response area, attached image. This is returned in the response so you can use the response payload.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- CHECKOUT.ORDER.APPROVED vs PAYMENT.CAPTURE.COMPLETED in REST APIs
- Express checkout re-authorisation requests in NVP/SOAP APIs
- v2 REST API CAPTURE not working in REST APIs
- 400 Bad Request when button pressed - happening more frequently! in PayPal Payments Standard
- Internal Server/Service Error when trying to authorise an Checkout v2 Order in REST APIs