Checkout cancel

cancel Callback

The cancel callback is invoked when the payer choose to cancel a payment.


Usage Copied to clipboard

The cancel callback must be defined using the data-cancel attribute on the Checkout script tag. The attribute value may be the name of a global function or a URL string.


Example Copied to clipboard

<html>
    <head>
        <script src="https://ap-gateway.mastercard.com/static/checkout/checkout.min.js"
                data-cancel="cancelCallback"></script>

        <script type="text/javascript">
                function cancelCallback() {
                    //handle payment being cancelled
                }
        </script>
    </head>
    ...
</html>
<html>
    <head>
        <script src="https://ap-gateway.mastercard.com/static/checkout/checkout.min.js"
                data-cancel="http://[your domain]/cancelPage"></script>
    </head>
    ...
</html>

Arguments Copied to clipboard

None


Return Value Copied to clipboard

None