Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

XMLHttpRequest cannot load #83

Closed
nodu opened this issue Apr 16, 2015 · 4 comments
Closed

XMLHttpRequest cannot load #83

nodu opened this issue Apr 16, 2015 · 4 comments
Labels

Comments

@nodu
Copy link

nodu commented Apr 16, 2015

Hi I've been trying to integrate this into my webapp. I've followed the great guide found here: https://devblog.paypal.com/building-a-web-app-with-node-js-the-paypal-sdk-part-2/

For the life of me, I cannot get rid of this error:
XMLHttpRequest cannot load https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-0LF19022L82747826. The request was redirected to 'https://www.sandbox.paypal.com/hk/cgi-bin/merchantpaymentweb?cmd=_flow&SESS…e0b7e69bf0224adecfb0124e9b61f737ba21b08198ecd47ed44bac94cd6fd721232afa4155', which is disallowed for cross-origin requests that require preflight.

I've tried adding the cors package, no success.
I've tried modifying the headers on the request, no success.

I'm not sure the direction forward, any help would be greatly appreciated!

@avidas
Copy link
Contributor

avidas commented Apr 16, 2015

Hey, @nodu can you share your node/express app server configurations and what headers you are modifying? This could be related to this issue or this one

@nodu
Copy link
Author

nodu commented Apr 16, 2015

Hi @avidas, thanks for replying. OK, I'm making an ajax POST via superagent to my server http://localhost:8081/create, the server then runs the same code in devblog.paypal for the same /create action. I've taken out all header modifications as none of them seemed to work and I'm still getting the same error. Where should I add which headers? I've tried all the possible configurations several times, but must be missing the correct one!

@avidas
Copy link
Contributor

avidas commented Apr 21, 2015

@nodu , have you just tried out the samples from https://github.com/paypal/PayPal-node-SDK/blob/master/samples/payment/create_with_paypal.js and https://github.com/paypal/PayPal-node-SDK/blob/master/samples/payment/execute.js ? Together they show how to create a payment with paypal (then you have to visit the approval_url and approve the payment) and then execute the payment. I would suggest doing those with your client_id/secret config and see if you get to an approved paypal payment(happens after successfully calling execute on payment). If you do, it is likely issue with app/browser settings and not the sdk. Also have a look at the deployed app http://pprestnode.herokuapp.com/

@avidas
Copy link
Contributor

avidas commented May 12, 2015

Closing as most likely unrelated to sdk, reopen if necessary.

@avidas avidas closed this as completed May 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants