New to the community? Welcome! Please read our Community Rules and Guidelines
Pay, shop, and do even more on the PayPal appGet the App
Hello,
I am integrating PayPal SmartButton into our site using SPA.
In the Checkout Page, I create a PayPal button. However, Users can go back to the homepage from here, so the PayPal Smart button's DOM will be lost and SDK will fire "Window closed" exception.
I tried to find in your documents but found no way to destroy created Smart Button.
So is there any way to remove Smart Button without having exceptions?
Im having a similar problem in my angular spa. I created a shopping cart interface and after I one initial purchase, every item I add to the cart just automatically goes to payment approved instead of waiting for another payment.
I ended up just clearing the container HTML. Might be hacky, but works.
e.g using JQuery:
$('#paypal-button-container').html('');
©1999-2023 PayPal, Inc. All rights reserved.