简体   繁体   中英

PayPal checkout integration with JS SDK Buttons - Problem with “Invalid sdk meta”

I'm trying to integrate PayPal Buttons with PayPal SDK on my FrontEnd. The SDK is loaded from

//www.paypal.com/sdk/js?client-id=<My-SandBox-Client-Id>

The script is loading correctly and when I do render buttons into my page it looks good as well. But there are 3 problems:

  1. Loading animation points are still hang at the bottom of the buttons: 在此处输入图像描述
  2. In developer tools I can see the broken request (400) which says:
Invalid sdk meta: eyJ1cmwiOiIvL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QWYtd0RUQlhVSjBFVE9hWWl6eXFVNDdPbVdxc0tvYmNpOVM1RzQya2FfR1RBeTZSR1pZNU1MUVBEdkw4VWJ0amx4QlJxdXMzWFBPNGUxWGEiLCJzdGFnZUhvc3QiOm51bGwsImFwaVN0YWdlSG9zdCI6bnVsbH0

Request is going to:

https://www.sandbox.paypal.com/smart/buttons?{private data}
  1. When clicking on any button, there is only spinning animation without loading any further data. No error message is provided.

I followed these integration guide: https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page

I have also found the same question without any answer on PayPal Community page: https://www.paypal-community.com/t5/Merchant-services-Archive/Invalid-sdk-meta/mp/1831011

I am wondering why PayPal doesn't help with integration on own community pages, and hope somebody here can help me to find out what is could be wrong.

Found the solution: make sure you are including script from https:// . Otherwise by loading from http:// script becomes a redirect to https:// and this runs in the described error above. So the correct link to the script is:

https://www.paypal.com/sdk/js?client-id=<My-SandBox-Client-Id>

Hopes it may help someone facing the same problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM