Paypal Smart Payment Buttons plugin issues

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Currently running pretty vanilla NOP 4.20
This is a live site and have customers actively viewing and Paypal payments are working as they should, however, I'm trying to incorporate Smart Payment Buttons to show the Paypal Credit option. This is the plugin I'm working with. I've also attempted the Foxsoft version of this with the same end results.

https://www.nopcommerce.com/paypal-smart-payment-buttons

Installed the above plugin and all seems to look correctly. Removed all other payment methods. Configured the plugin using Paypal ClientID and secret setup as instructed. When I attempt to checkout and use the Smart Payment buttons, I get a pop-up dialog box with a spinning icon. After waiting several minutes it doesn't resolve. No errors or warnings are showing in NOP log. I'm at a loss as to why this isn't working. Anyone else using this or having similar issues?
4 years ago
1. Do you see any javascript errors in the Google Chrome console?
2. What is your website URL?
4 years ago
No errors in Google Dev console or in general. Site is www.dsperformance.net however I have the plugging disabled at the moment. But can arrange a time to enable.
4 years ago
I am receiving an error...
Failed to load resource: the server responded with a status of 400 ()

www.paypal.com/smart/buttons?
style.label=paypal
&style.layout=vertical
&style.color=blue
&style.shape=rect
&style.tagline=
&components.0=buttons
&locale.country=US
&locale.lang=en
&sdkMeta=eyJ1cmwiOiIvL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVVURGZsT0tucVNnaE11bk9rdm1fT0p6OUF2NFpMUnFubHJFOGFTSjZBZHZsTDJGRk1O
emIwa09HYWVKRzZVRWRlNzVBVDZKeEl3SzBudFImY3VycmVuY3k9VVNEJmludGVudD1jYXB0dXJlJmNvbW1pdD1mYWxzZSZ2YXVsdD1mYWxzZSZkZWJ1Zz1mYWxzZSIsInN0Y
WdlSG9zdCI6bnVsbCwiYXBpU3RhZ2VIb3N0IjpudWxsfQ
&clientID=AUTDflOKnqSghMunOkvm_OJz9Av4ZLRqnlrE8aSJ6AdvlL2FFMNzb0kOGaeJG6UEde75AT6JxIwK0ntR
&sessionID=cb4cd898ad_mtg6mdu6mzc
&buttonSessionID=1a001f77ae_mtg6mdc6ntu
&env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byI6eyJlbGlnaWJsZSI6ZmFsc2V9fQ==
&platform=desktop
&currency=USD
&intent=capture:1
Failed to load resource: the server responded with a status of 400 ()
4 years ago
probably don't want your production clientID out there on the internet, I recommend creating a new one before going live again

if you visit that URL directly in the browser it displays the JSON response:


Invalid sdk meta: eyJ1cmwiOiIvL3d3dy5wYXlwYWwuY29tL3Nkay9qcz9jbGllbnQtaWQ9QVVURGZsT0tucVNnaE11bk9rdm1fT0p6OUF2NFpMUnFubHJFOGFTSjZBZHZsTDJGRk1OemIwa09HYWVKRzZVRWRlNzVBVDZKeEl3SzBudFImY3VycmVuY3k9VVNEJmludGVudD1jYXB0dXJlJmNvbW1pdD1mYWxzZSZ2YXVsdD1mYWxzZSZkZWJ1Zz1mYWxzZSIsInN0YWdlSG9zdCI6bnVsbCwiYXBpU3RhZ2VIb3N0IjpudWxsfQ


same issue here:
https://stackoverflow.com/questions/58859563/paypal-checkout-integration-with-js-sdk-buttons-problem-with-invalid-sdk-meta

I browsed your site and it forces https so I'm not sure why the buttons are being called over http, but I don't see https in the URL you provided so maybe that will get you started in the right direction

do you have a dev/staging environment that you can test to PayPal's sandbox?  it would be immensely beneficial to be able to step through the code
4 years ago
Thanks for the info. I don't have a dev environment currently. This is a testing clientId I'm using and will revert to my production clientId when I have a resolution. I'll look into the link you sent and see if anything pops up from that. Thanks for the response!
4 years ago
Double check that you're not using a sandbox client for production.  I get a different error mixing up credentials  (paypal failed to create an order ID) , but it's worth a quick check.

However, I can exactly reproduce what you're seeing if I set the ServiceScriptUrl property in Defaults.cs to http://

public static string ServiceScriptUrl => "http://www.paypal.com/sdk/js";




If you have the source code you should double check that hasn't been edited from https for some reason.  If you're using the precompiled binaries then it's something else, and since you get the same behavior with both plugins I'm guessing it's something with your server configuration.

PayPal only supports TLS 1.2.  I took the liberty of checking your domain over at SSLLabs.com and it says that your server still supports TLS 1.1, so there is a chance that PayPal's SDK isn't loading over that protocol.  You would think it would use the most secure, but who knows.  Also, makes sure it's using HTTP/1.1 in your dev console.  

If you have access to the server there is a great tool called IIS Crypto that makes disabling TLS 1.0 / 1.1 a breeze, otherwise google how to edit the registry.  

I can't guarantee that's the problem, but it's where I would start.
4 years ago
I'm not using a Sandbox API. I'll look into this TLS1.2 which Paypal requires. My site is only using 1.1 like you said. I'll see what I can figure out on getting this changed over.
As for server access..I don't have much access other that what's allowed through my hosting provider's console (smarterasp.net)
4 years ago
I see the Default.cs in the source code and it is using the https://, however, I'm using the compiled plugin. I'd assume it was compiled from this though.
4 years ago
Yeah, it's going to be a server configuration issue since the same thing occurs with both Nop's and Fox's plugins.  I'd contact smarterasp and have them disable TLS 1.1 before anything else.  At the very least we'll rule that out while making your site more secure.  

Also, it's not too time consuming to install Visual Studio, SQL Server Dev, and another instance of NopCommerce on a local machine for testing.  You'll drive yourself insane chasing these issues on a live site.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.