On this page
No Headings
Last updated: June 16, 2026
Show a page to your payers to confirm that the payment was cancelled.
Complete the steps in Get started to get your sandbox account login information and access token from the Developer Dashboard.
This feature modifies an existing Expanded Checkout integration and uses the following:
You can use Postman to explore and test PayPal APIs. Learn more in our Postman guide.
Add the onCancel function to the JavaScript that renders the PayPal buttons to show a cancellation page when a payer cancels a payment:
paypal.Buttons({
onCancel: function(data) {
// Show a cancel page or return to cart
}
}).render('#paypal-button-container');