> For the complete documentation index, see [llms.txt](https://help.checkoutchamp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.checkoutchamp.com/crm/gateway-setup/gateway-integrations/airwallex.md).

# Airwallex

<figure><img src="/files/lU8MHaHHQDSp37U3c64j" alt=""><figcaption></figcaption></figure>

<p align="center"><a href="https://www.airwallex.com/gtmp/payments/integration-partners/checkoutchamp?utm_source=gtm-partner&#x26;utm_medium=partner_referral&#x26;utm_campaign=v01_glbl_multi_ib_dg_prttm_gen_checkoutchamp&#x26;sfcid=701Nn00000Sc3JJIAZ">CLICK HERE</a> to learn more about the Airwallex integration with Checkout Champ!</p>

{% hint style="info" %}
Airwallex supports multiple payment methods - credit card, [Apple Pay](#apple-pay), [Google Pay](#google-pay), Afterpay, BLIK, Bancontact, BLIK, iDEAL, P24, Klarna, EPS, MyBank, PayU, Trustly, and SEPA Direct Debit.
{% endhint %}

{% hint style="warning" %}

* Contact Airwallex to enable the third-party 3DS feature
* Contact Airwallex to enable the skip 3DS feature
  {% endhint %}

**STEP 1**

Go to **Gateways** | **Gateway Integrations** and select the Airwallex tile. Click on **+Activate**.

<figure><img src="/files/ya5JNvIc8pM1dIXPrW05" alt="" width="375"><figcaption></figcaption></figure>

#### STEP 2

Enter a Title for the gateway.

Then enter the following information specific to Airwallex:

**clientId -** obtained from Airwallex

<figure><img src="/files/MpG0wMygGP4LAXbXXEnT" alt="" width="563"><figcaption></figcaption></figure>

**apiKey** - obtained from Airwallex.  This must be a restricted API key.  The restricted API key must be set with only the permission **Payment Acceptance → Payment Acceptance (Edit & View)**.  Do not set any other permissions.  Follow instructions [here](https://www.airwallex.com/docs/developer-tools__api__manage-api-keys).

**secure3DS** - choose Default, Skip, or Force.  Check with your Airwallex account manager for the proper choice.

**sendUpsellToken** - choose to send a payment token instead of card number on upsells.

**useTestServer** - use sandbox credentials to test the integration. Be sure this is unchecked for live processing.

<figure><img src="/files/Zt4OeXMAnmWV9XyjNvIP" alt="" width="375"><figcaption></figcaption></figure>

Nothing else is required on this page.  Please review this [document ](/crm/gateway-setup/adding-a-gateway.md)for more details.  Press <mark style="color:green;">**Create Gateway**</mark> when finished.

{% hint style="info" %}
Steps 3-5 can be skipped if using CheckoutChamp hosted pages
{% endhint %}

**STEP 3**

Add the hidden input browserData inside of the same form as the card input.

`<input type="hidden" name="browserData" value="" id="browserData">`

**STEP 4**

Add this script to your page before the closing body tag.

```
<script type="text/javascript">
    const navigator = window.navigator;
    const browserData = {
        acceptHeader: 'application/json',
        userAgent: navigator.userAgent,
        language: navigator.language,
        timezone: (new Date()).getTimezoneOffset().toString(),
        colorDepth: screen.colorDepth,
        screen: {
            height: screen.height.toString(),
            width: screen.width.toString()
        },
        javaScriptEnabled: true,
        javaEnabled: navigator.javaEnabled()
    };
    document.getElementById('browserData').value = JSON.stringify(browserData);
</script>
```

#### STEP 5

If using Secure 3DS be sure the checkout page supports the challenge requests

[Basic 3DS Instructions](/crm/gateway-setup/direct-api-3ds-instructions.md)

#### STEP 6

Airwallex require a fraud fingerprint be submitted with the sale.  Place this script onto the checkout page.  It creates an Airwallex fingerprint and places the ID into a hidden fraudSessionId element.  Pass this element value as "fraudSessionId" on Import Order API.

If using CheckoutChamp hosted pages then this script must be pasted into your checkout page.  However the fraudSessionId is automatically passed with the order.  There is no additional coding needed.

```
(function () {
    'use strict';

    const SCRIPT_ID = 'airwallex-fraud-api';
    if (document.getElementById(SCRIPT_ID)) {
        return;
    }

    const generateUUID = function () {
        if (
            typeof crypto !== 'undefined' &&
            typeof crypto.randomUUID === 'function'
        ) {
            return crypto.randomUUID();
        }

        if (
            typeof crypto !== 'undefined' &&
            typeof crypto.getRandomValues === 'function'
        ) {
            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
                /[xy]/g,
                function (c) {
                    const arr = new Uint8Array(1);
                    crypto.getRandomValues(arr);
                    const r = arr[0] % 16;
                    return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
                }
            );
        }

        let timestamp = new Date().getTime();
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
            /[xy]/g,
            function (c) {
                const r = (timestamp + Math.random() * 16) % 16 | 0;
                timestamp = Math.floor(timestamp / 16);
                return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
            }
        );
    };

    const fraudSessionId = generateUUID();

    const appendHiddenInput = function () {
        const el = document.createElement('input');
        el.type = 'hidden';
        el.name = 'fraudSessionId';
        el.value = fraudSessionId;
        (document.body || document.documentElement).appendChild(el);
    };

    const fraudScript = document.createElement('script');
    fraudScript.type = 'text/javascript';
    fraudScript.id = SCRIPT_ID;
    fraudScript.async = true;
    fraudScript.src = 'https://static.airwallex.com/webapp/fraud/device-fingerprint/index.js';
    fraudScript.setAttribute('data-order-session-id', fraudSessionId);
    fraudScript.onload = appendHiddenInput;
    fraudScript.onerror = function () {
        console.warn('[airwallex-fraud] Failed to load device fingerprint script.');
    };

    document.head.appendChild(fraudScript);
}());
```

#### Apple Pay

If using CheckoutChamp pages then follow Apple Pay instructions [here](/funnel-builder/creating-and-editing-funnels-pages/funnel-visualizer-and-page-builder/funnel-visualizer/edit-funnel-settings/payments/apple-pay.md).

If not using CheckoutChamp pages then obtain the appropriate token on your page and pass **applePayToken** to CheckoutChamp on the [Import Order](https://apidocs.checkoutchamp.com/#275a54c6-b4b0-414c-819b-7387e9a81f58) API call.

#### Google Pay

If using CheckoutChamp pages then follow Google Pay instructions [here](/funnel-builder/creating-and-editing-funnels-pages/funnel-visualizer-and-page-builder/funnel-visualizer/edit-funnel-settings/payments/google-pay.md).

If not using CheckoutChamp pages then obtain the appropriate token on your page and pass **googlePayToken** to CheckoutChamp on the [Import Order](https://apidocs.checkoutchamp.com/#275a54c6-b4b0-414c-819b-7387e9a81f58) API call.
