Reputation: 890
I am trying to make a checkout using paypal-rest-sdk and when after successful response it is redirecting to the approval_url then it is giving error as given below.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-9TM98470K35457508 with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
paypal.payment.create(create_payment_json, function (error, payment) {
if (error) {
res.status(500).json({success: false,msg:'error -'+ error});
}
else {
for(var i = 0; i < payment.links.length; i++){
if(payment.links[i].rel === 'approval_url' &&
payment.links[i].method === 'REDIRECT'){
// this is coming in console
console.log('payment is processing');
// error is coming here when redirecting to payment gate
res.redirect(payment.links[i].href);
}
}
}
});
It should successfully redirect to the payment gateway.
Upvotes: 0
Views: 3466
Reputation: 944069
The error is coming from your browser, not from Node.js.
You need to consider your browser-side code.
It sounds like you are making an HTTP request using Ajax and expecting to get JSON back. You are responding with either a 500 error and some JSON or a redirect to some HTML.
Since the client is expecting JSON, it complains.
It sounds like you shouldn't be using Ajax in the first place.
Upvotes: 1