Checkout beforeRedirect

beforeRedirect Callback

The beforeRedirect callback is invoked before browser redirects occur during the payment flow. The return value of the callback will be stored until the browser is returned to the merchant page. The value can be recovered with the afterRedirect callback.

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

Usage Copied to clipboard

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

Example Copied to clipboard

        <script src=""
        <script type="text/javascript">
                function getPageState() {
                    return {
                        foo: "string",
                        bar: 123.45

Arguments Copied to clipboard


Return Value Copied to clipboard

data Copied to clipboard Object

A JSON serializable object.