## Cancel event The `cancel` event is emitted from a [PaymentRequest](/js/payment_request.md) when the browser‘s payment interface is dismissed. Note that in some browsers, the payment interface may be dismissed by the customer even after they authorize the payment. This means that you may receive a `cancel` event on your PaymentRequest object after receiving a `token`, `paymentmethod`, or `source` 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. **Syntax:** `paymentRequest.on(...)` - `event` (string) **required** The name of the event. In this case, `cancel`. - `handler` (function) **required** A callback function that you will provide that will be called when the event is fired. ### Handle 'cancel' event ```js paymentRequest.on('cancel', function() { // handle cancel event }); ``` ```es_next paymentRequest.on('cancel', () => { // handle cancel event }); ```