Using Paypal Smart Buttons for checkout sometimes fails with Debit/ Credit Cards Form

tutor-for-life
New Community Member

After following the integration guide for JS and the paypal-react-js library, I've added the react Paypal buttons to my website. The order is created and captured both on my website. End result looks like the normal Paypal buttons.

tutorforlife_0-1713965740512.png

Now what I've noticed after testing this in different settings and not in production is that the yellow Paypal buttons always load the PopUp correctly and let the user checkout. However, about 20% of the time, customers have reported that the black "Debiut or Credit Card" Button fails to show anything but a spinning loader.

tutorforlife_1-1713965868560.png

Now the interesting things is that this can be triggered by clicking the black CC button, loading the form correctly, clicking the small "X" to close the CC form, then clicking the black CC button again. The Form will fail to load with the following console error:

`Failed to load resource: the server responded with a status of 400 () https://www.sandbox.paypal.com/smart/card-fields?sessionID=uid_33e29de752_mtm6mtk6mty&buttonSessionI...

So I figure this is an issue in how the Paypal SDK handles cookies and sessions. Looking in the localStorage, I see the following value `__paypal_storage__` which contains a json like this:
{"id":"uid_80e2de125e_mtm6ndi6mje","__session__":{"guid":"uid_8f2743e801_mtm6ndi6ndk","created":1713966169717,"state":{}}}

I found that by clearing this local session token, I can SOMETIMES fix this issue and clicking the black button again brings up the CC form correctly. However, this doesn't work every time. So the question is, why are the smart buttons being fickle?? checking the Dev Paypal console, I can see that my createOrder calls are successful.

Login to Me Too
4 REPLIES 4

enekaken
New Community Member

I'm experiencing the same issue as well.

Login to Me Too

Shuchita_001
Contributor
Contributor

Dear PayPal Support Team,

I am experiencing an issue with the "Debit or Credit Card" button (black button) when using PayPal Smart Buttons on my website. While the yellow PayPal button consistently loads the pop-up and allows users to check out without any issues, about 20 to 40% of the time, the black "Debit or Credit Card" button fails to display anything but a spinning loader.

Here are the details of the issue:

Step to reproduce the issue:
- Click the black "Debit or Credit Card" button, and the form loads correctly.
- Close the form by clicking the small "X" button.
- Click the black "Debit or Credit Card" button again.
- The form fails to load, and the console displays the following error: Failed to load resource: the server responded with a status of 400 () https://www.sandbox.paypal.com/smart/card-fields?sessionID=uid_cda78e1b66_mdc6mjk6ntc&buttonSessionI...


The same issue sometimes occur on the first click on the black button "Debit or Credit Card".

Clearing the local session token sometimes resolves the issue temporarily, but not completely.

Shuchita_001_2-1716277061040.png

 



Shuchita_001_0-1716277038303.png

 


Thank you for your support.

Best regards

Login to Me Too

jmena28
New Community Member

Any solution ?

Login to Me Too

jmena28
New Community Member

Or any workaround to stop this loading state when this 400 error happens ?

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.