Sandbox Account - Error Order could not be captured
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've got a sandbox account that was working OK, the site is just about to go live and I am now consistently getting the above error.
I'm using paypay.Buttons:-
paypal.Buttons({ createOrder: ( data, actions ) => { return actions.order.create({ purchase_units: [{ amount: { value: this.amount.toFixed(2), currency_code: "GBP", } }] }) }, onApprove: ( data, actions ) => { return actions.order.capture().then(details => { console.log('details',details); }) }, onError: ( error ) => { console.log('error',error); } }).render('#paypal-button-container')
The endpoint failing is:- POST to https://www.sandbox.paypal.com/smart/api/order/9SS20746CE045201T/capture
There's about 16k of output to console, but the final part is:-
Error: Order could not be captured
at Yt.(anonymous function) (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:51457)
at Object.<anonymous> (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:57716)
at JSON.parse (<anonymous>)
at o (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:57576)
at ir (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:57727)
at Er.u.on (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:62490)
at Er (https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:62679)
at https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:67116
at https://www.paypal.com/sdk/js?client-id=AQ0BP............LKMvKBB7Qd¤cy=GBP:1:67162
Any assistance is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The same thing happens to me suddenly, I think it's because of the session, because once it expires and I re-enter with the buyer's account it works without errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks - @Domingofhernand - this is exactly the problem I have and the correct solution.
Simply log out and back into the PayPal acoount.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you just press the overlay that says "Don’t see the secure PayPal browser? We’ll help you re-launch the window to complete your purchase" it will re-load the pay window and all will be fine. Just click it a few times before trying a payment to be safe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was using brave browser. I don't know why but when I tested it in firefox the error got solved.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Platform Marketplace integration approval in Sandbox Environment
- API TRANSACTION_REFUSED in Sandbox when Capturing Payment in REST APIs
- Enable Billing Address Feature in Sandbox Environment
- Simple Paypal button integration results in 404 error in Sandbox Environment
- Error linking personal sandbox account with partner api in Sandbox Environment