afterRedirect Callback

The afterRedirect callback is invoked when the browser returns to the merchant page after a redirect to a third-party site. If the beforeRedirect callback was used, the value returned from that callback will be passed to afterRedirect as an argument.

Payment method such as PayPal requires the browser to be redirected away from a merchant page.


The afterRedirect callback must be defined using the data-afterRedirect attribute on the Checkout script tag. The attribute value must be the name of a global function.


        <script src=""
        <script type="text/javascript">
            function restorePageState(data) {
                //set page state from data object


data Object
The object that was returned from beforeRedirect callback, if any.

Return Value


Copyright © 2023 Mastercard