RuSsCiTy
RuSsCiTy

Reputation: 466

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: enter image description here
  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/m-p/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.

Upvotes: 4

Views: 1673

Answers (2)

vhng
vhng

Reputation: 11

I encountered this issue on Drupal and found that the Advanced Aggregation module was removing the https:// and causing the bug as RuSsCiTy mentioned.

Specifically, I needed to disable the "Convert absolute paths to protocol relative paths" (under "Obscure options"):

enter image description here

Upvotes: 1

RuSsCiTy
RuSsCiTy

Reputation: 466

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.

Upvotes: 5

Related Questions