continuous-software / 42-cent-paypal

Node.js SDK for Paypal payment gateway.
https://paypal.com/
MIT License
3 stars 4 forks source link

When I run test, they fail. #2

Closed rhedin closed 5 years ago

rhedin commented 7 years ago

I have provided a CLIENT_ID and a CLIENT_SECRET. I invoke the tests this way:

CLIENT_ID=ofcoursewheniinvokeit CLIENT_SECRET=iputintherealclientsecret npm test

I have commented out all but one test to try to localize the problem. I put a console.log in the node_modules/paypal-rest-sdk/lib/client.js file. Not only are the client id and the client secret not present in the request, an http option withCredentials=false is hard-coded.

The https request does not seem to be mocked. It seems to actually be going out to Paypal. Maybe I am wrong about that.

Anyway, I don't seem to be able to make it work, so far. Guidance?

lorenzofox3 commented 7 years ago

Request are not mocked. The tests are integrations tests. I don't remember exactly but you probably need a merchant account at Paypal with sandbox configured to test .