Describe the bug
The PayPal sdk gets called by the local site, even when there are no keys specified in .env
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the keys are missing, PayPal should not be contacted.
Screenshots
/cc @ahmadabdolsaheb 馃し
Hello guys!
Does this happen on /donate
page or somewhere else too?
I noticed that this page fails to load also because of the missing Stripe API key for me. Can't recreate it anymore, happend only once.
I'd like to help with that issue if you don't mind
Also, I noticed PaypalButton has a typo clinetId
-> clientId
in props, example: https://github.com/freeCodeCamp/freeCodeCamp/blob/master/client/src/components/Donation/PaypalButton.js#L82
@UgRoss, it should happen if you hard refresh on donation page. (and on donation modal)
That script loads the button.
A solution would be to check for paypalClientId in the render of PaypalButton component and return PayPalButtonScriptLoader only if paypalClientId is truthy.
PR is ready. Could you please take a look?
Also about the Stripe issue. I'm not sure if it's expected/known but if I don't configure the key for stripe, the /donate
page isn't loading for me at all.
Yikes, that seems like it needs a fix as well. Thanks for catching that.
Most helpful comment
@UgRoss, it should happen if you hard refresh on donation page. (and on donation modal)
That script loads the button.
A solution would be to check for paypalClientId in the render of PaypalButton component and return PayPalButtonScriptLoader only if paypalClientId is truthy.