Posted: September 27, 2024 at 11:46 am
September 27, 2024 at 11:46 am We are switching from Paypal Pro to Paypal Commerce. We follow the steps to “Connect with Paypal” which seems to be successful on the Paypal side (in the Paypal account). However, nothing changes in the EE/Paypal Commerce plugin: so we do not get the “connected” message, just the “Connect with Paypal (sandbox)” button remains. We have tried to clear cache and “clear Paypal Commerce metadata” and retried a few times. If we try to purchase a ticket on the front-end we get an error “no payment method is active.” Can you please advise? |
|
Hi there, This message – “Connect with Paypal (sandbox)” Means you have the payment method in debug mode and a sandbox account is separate from your live account. In the payment method settings make sure ‘Sandbox Mode On’ is set to No and then try to connect to PayPal. Does it work then? |
|
September 28, 2024 at 10:41 am Ok we tried again and there is no change (still says “Connect with Paypal”). Please advise. |
|
September 28, 2024 at 10:42 am No. We tried again and there is no change (still says “Connect with Paypal”). Please advise. |
|
September 28, 2024 at 10:43 am No. We tried again and there is no change (still says “Connect with Paypal”). Please advise. |
|
Hi there, Can I take a look at the site? I’d like to try connecting my account and see if there are any errors thrown in the background (I’ll obviously disconnect again if it works etc) If that’s ok, just send temp login details over using this form: |
|
Can you please try again and let me know if it works this time? |
|
Ok it looks like the connection was successful but please see the attached (screen shot) error when attempting a ticket purchase…. Error response… Paypal Commerce checkout Javascript was not loaded properly… can’t be processed. |
|
Hmm, something very weird going on there. The PayPal .js file (which loads directly from PayPal) isn’t getting any query parameters passed to the file when we call it. Even if you have zero details from your account there are hardcoded values that must be sent when loading that .js file, but none of those are being passed. Can I add some debug code to the site to see what is happening? I’ll need FTP access if that’s the ok: |
|
Yes please do whatever is needed. I sent you all login and FTP details a few days ago. Do you need them again? |
|
My apologies, you’ve submitted the form twice, the second one (which I had open at the time of my above reply) just has WP Admin creds, but the first included both and I didn’t check. Ok, so the issue here is from code within the theme:
Thats in That code takes all scripts loading on the site and removes everything within the query string, not just version numbers. So when we try to enqueue the PayPal SDK and pass in the required details, we say the script URL is something like:
The above code then hooks and removes everything after the
That’s why you’re getting the current issue with PayPal. You’ll need to remove that code from the site, or if you really want to use it, you can check the handle of scripts you are processing and exclude at least the PayPal SDK handle. https://developer.wordpress.org/reference/hooks/script_loader_src/ |
|
Ok, that seems to have worked. Thank you! |
|
You’re most welcome. Any further issues just let me know. |
|
You must be logged in to reply to this support post. Sign In or Register for an Account