## Cancel event The `cancel` event is triggered from the Express Checkout Element when the payment interface is dismissed. Note that in some browsers, the payment interface might be dismissed by the customer even after they authorize the payment. This means that you might receive a `cancel` event after receiving a `confirm` event. If you're using the `cancel` event as a hook for canceling the customer's order, make sure you also refund the payment that you just created. This event is only available on the Express Checkout Element. **Syntax:** `expressCheckoutElement.on(...)` - `event` (string) **required** The name of the event. In this case, `cancel`. - `handler` (function) **required** A callback function that you provide that's called after the event is fired. ### Handle 'cancel' event ```js const expressCheckoutElement = checkout.createExpressCheckoutElement(); expressCheckoutElement.on('cancel', function() { // handle cancel event }); ``` ```es_next const expressCheckoutElement = checkout.createExpressCheckoutElement(); expressCheckoutElement.on('cancel', () => { // handle cancel event }); ```