Show cancellation page

DocsCurrentADVANCED

Last updated: Apr 19th, 11:28pm

Show a page to your payers to confirm that the payment was cancelled.

Know before you code

Required
Advanced Checkout

Get started

Optional
Explore PayPal APIs with Postman

You can use Postman to explore and test PayPal APIs. Learn more in our Postman guide.

Display a cancellation page

Add the onCancel function to the JavaScript that renders the PayPal buttons to show a cancellation page when a payer cancels a payment:

    1paypal.Buttons({
    2 onCancel: function(data) {
    3 // Show a cancel page or return to cart
    4 }
    5}).render('#paypal-button-container');

    If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more