400 Error just loading the JS SDK in standard Chrome on PC

JohnnyBurbank
Contributor
Contributor

I'm currently using the JS SDK via this line as described on the Smart Buttons site on Paypal, which is using my sandbox id.  

<script src='https://www.paypal.com/sdk/js?client-id=AYwrV-MD9W7255v6j5g4Sp4RBtaTJGNrsQ_246qJObnT4eKa96FptSM0AVQX...'></script> 

 

If enough time has passed and I come back to visit the page where this is called, the Paypal Smart Buttons don't appear and there's a 400 error in the Chrome console.  There are several additional unusual behaviors here. 

1) If I just put the address (https://www.paypal.com/sdk/js?client-id=AYwrV-MD9W7255v6j5g4Sp4RBtaTJGNrsQ_246qJObnT4eKa96FptSM0AVQX...) into Chrome's address bar, I get a "This page isn't working. HTTP Error 400."  How can it be an error 400 when the only thing I'm passing is my client-id?!?

2) If I remove the "&disable-funding=credit", same problem.

3) I've tried unloading all my Chrome plug-ins, same problem.

4) If I try my LIVE client-id, same problem.

5) If I clear cache and cookies, same problem.

6) However, if I load the page in Chrome in Incognito Mode it WORKS! (One reason, I thought unloading my plugins above might fix it)

7) If I load the site on my PC in IE(or Edge or whatever its called these days), it WORKS!

😎 If I load it on Chrome or Safari on my iPhone it WORKS!

9) Stranger still, if I get it working on 6,7, or 8 above, the page on my PC in Chrome will suddenly start working.

 

It's almost as if the address needs a jump start from some device/browser/mode OTHER than standard Chrome on my PC and THEN it starts working on Chrome on my PC (until some amount of time passes and I check it again the next day, for example, and then it'll stop working again).  The problem has persisted every day I come back to check it out with the above scenarios for the last several weeks.  Any ideas?

Login to Me Too
6 REPLIES 6

lagreeno
Contributor
Contributor

Hi there,

 

I have totally the same issue here and it's really frustrating! I wanted to create the new issue regarding this but then i found yours. 

 

We have integrated this Paypal Smart Button on our site for subscription based payments and wanted to start to use it in production but then discovered that it doesn't work. Basically it doesn't matter if you use sandbox client-id or LIVE env id's the issue is the same =>>> 400 error code as response. The most "interesting" part is that it sometimes works for some hours every day without us changing or doing anything (as you mentioned that you start it from PC or mobile and then it starts to work -> for us it just suddenly starts to work).

 

This is pretty huge blocker because we can't use this integration for production env. And when I check the developers portal  (https://developer.paypal.com/docs/checkout/#) I don't see any "notes" that it can't be used for LIVE sites. But taking all the info that i mentioned (and from the main description for this topic) into account it actually can't be used at all.

 

We would really appreciate any information how to fix this?

 

Thanks a lot! 

 

Login to Me Too

shawnz
Contributor
Contributor

I had the same issue and it seemed to be caused by switching between the sandbox API and the live API while debugging. I was able to resolve the issue by deleting ALL cookies for all paypal.com domains and then doing a hard refresh on my app's page. Are you sure you cleared all paypal related cookies, including those for the sandbox, etc?

Login to Me Too

JohnnyBurbank
Contributor
Contributor

Interesting.  I'm not sure if it had anything to do with switching between sandbox and live, but I now realize that when I originally cleared all cookies, i cleared them for my site's domain, NOT paypal's domain.  Clearing paypal's domain seems to have fixed it for now.  So now I just need to check and see if it's still working in 6 hours (the time I determined that it takes for the site to break once it's working again). So now I wonder if just logging into multiple paypal accounts has got the site confused about who I am and somehow jacks up the results.  And if that's actually the case, then I imagine I can be less concerned about a customer running into the same issue.  If it's good again when I check in the morning, I'll mark this solved!  Thanks shawnz!

Login to Me Too

shawnz
Contributor
Contributor

Yes, I had the same theory and I'm hoping it's accurate because as you say that would mean it's unlikely a customer will be affected by this. But I'm not totally sure, I only experienced the problem a couple of times so far. If the solution works for you also I'll be much more reassured.

 

Good luck, Shawn

Login to Me Too

lagreeno
Contributor
Contributor

Hi again,

 

Small update from me too. Looks like this is cookie issue and it's local. When i hit the issue from my development computer - i checked our app from other computer (different browsers), mobile phones and the button was there. I cleared all the paypal related cookies (on my dev computer) and the buttons showed up in my developer env too.

 

Thanks a lot for your comments!

Login to Me Too

JohnnyBurbank
Contributor
Contributor

That's it!  It's still working this morning.  I've got a ticket open about this with Paypal tech people so I'll add this info to it.  Also, the nice thing about this is if, in the small chance that a customer gets this error, I can pop up a message that tells them to clear their paypal.com cookies (assuming they know how to do it).  Hopefully the Paypal techs will make it so that won't be necessary in either case.  Thanks guys!

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.