Page 1 of 1

PayPal Cart - Java SDK

Posted: Sun Apr 26, 2026 10:52 pm
by TomB
Using WWB Version 21.0.4 - April 10, 2026

Transitioning a site currently using legacy PayPal buttons. If I set the buttons and cart to "Legacy Payment Button" the shopping cart's popup works as expected showing items placed in the cart and the total. When pressing the "PayPal" button on the pop-up the items are passed to PayPal and everything works as it should. The problem is when I change the cart to use the "PayPal Javascript SDK" and change the buttons to use the "Javascript SDK" all the "Add to Cart" buttons act as a "Buy Now" button and go directly to PayPal, not placing items in the cart. According to the Help file, I was led to believe the "Add to Cart" would work with SDK if used with the the Shopping Cart.
However, PayPal's JavaScript SDK does not provide 'Add to cart' and 'View Cart' functionality. it only supports 'Buy Now'. Alternatively, you can use the PayPal Shopping Cart object which has also been updated to support the JavaScript SDK. Also, the subscription button needs to be setup in the PayPal account.

When using the 'JavaScript SDK', you will need to use the 'Client ID' instead of the PayPal email address. This can be set globally in Tools -> Options -> eCommerce
The Client ID is set up on PayPal for both the Sandbox and Live. I've tried using both ID's with the same results.
What am I missing?

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 6:07 am
by Pablo
When using the PayPal Shopping Cart, then this object will be the checkout point.
The PayPal buttons are only use as 'triggers'. They need to be configured as classic PayPal button otherwise they will go directly to the PayPal website.

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 4:44 pm
by TomB
Thank you for clearing that up. Using the legacy buttons with Java SDK on the cart works as expected. Am I correct in assumming that the deprecated button <form action="https://www.paypal.com/cgi-bin/webscr"> and <input> elements are ignored while using the cart Javascript SDK?

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 4:49 pm
by Pablo
Correct. However, the shopping (cart which is a third party script) monitors for this legacy PayPal button clicks, so that is why it works this way.

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 5:25 pm
by TomB
So is it safe to assume the cart will continue to work after January 2027 when PayPal WPS is completly shut down, as long as the cart is using the Javascript SDK?

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 8:45 pm
by Pablo
Yes, the buttons are only used locally.
By the time the legacy buttons are no longer supported there will probably be a cleaner solution.
But for now, it's important to be backward compatible, while also supporting the new api.

Re: PayPal Cart - Java SDK

Posted: Mon Apr 27, 2026 8:49 pm
by TomB
Great! Thx