Uncaught DOMException error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting errors like this
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
when using
<script src="https://www.paypal.com/sdk/js?components=hosted-fields,buttons&client-id=<clinet-id>" data-client-token="<token>"></script>
with the code example for advanced credit and debit card payments
- Labels:
-
Mobile SDKs
-
REST SDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Comunity,
any one found an answer to this problem with the the Javacript SDK not working for the data-client-token, whihc as per the Javascript SDK says you can add as in paypal example below...
<script src="https://www.paypal.com/sdk/js?components=hosted-fields,buttons&client-id=<clinet-id>" data-client-token="<token>"></script>
Need to have this working so I can send a Client token to the IPN page to then link to clients buying services.
PAYPAL - Please reply to this as this has been on your comunity bord since 2020 1 and half years and you have not replied or helped!!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mabe it can help.
I've had the same problem.
I've change the POST cURL to obtain the Access Token putting the "grant_type":"client_credentials" in the post body instead of query parameter and now it works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have had the same problem, and been trying to figure it out all day...
In my case I rushing through the docs and mistakenly populating <YOUR-CLIENT-TOKEN> with <ACCESS-TOKEN>
<script src="https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=<YOUR-CLIENT-ID>" data-client-token="<YOUR-CLIENT-TOKEN>"></script>
so I need to make 2 curl requests 1 to make an <ACCESS-TOKEN> then use the <ACCESS-TOKEN> to make a second curl request
to generate a <YOUR-CLIENT-TOKEN>
Hope this helps any future devs that find this post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I too was struggling like hell to solve this, but finally after reading the documentation 1000 times I got to know where I was facing the issue.
In order to get the data-client-token value, we need to invoke 2 APIs:
1. https://api-m.sandbox.paypal.com/v1/oauth2/token : This retrieves the access token
(Refer this for more information: Get Access Token)
2. Then using the access token, we can retrieve the client token using the following API
https://api-m.sandbox.paypal.com/v1/identity/generate-token
(Refer this for more information: Generate Client Token )
Now the use the client token in the script
<script src="https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=<Client ID>" data-client-token="<Client Token from Step 2>"></script>
Paypal documentation surely needs to be improved!!!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- credit is not eligible unless vault=true in SDKs
- Help me find the solution for the error 'rwindow.paypal.Buttons is undefined.' in Next.js project in PayPal Payments Standard
- 406 Error Coming & Cart id in SDKs
- Cannot start a PayPal subscription in Sandbox Environment
- Corruption: block checksum mismatch in PayPal Payments Standard