Show cancellation page
DocsCurrentLast updated: March 16th 2023, @ 11:23:55 am
Show a page to your payers to confirm that the payment was cancelled.
Know before you code
This feature modifies an existing checkout integration and uses the following:
- PayPal JavaScript SDK
- Orders REST API - Create order endpoint
Use Postman to explore and test PayPal APIs.
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:
paypal.Buttons({
onCancel: function (data) {
// Show a cancel page or return to cart
}
}).render('#paypal-button-container');