# Connecting Trust Payments

> Connecting to Trust Payments uses API credentials. The integration uses a combination of the Trust Payments Web Services API and JavaScript, so you will create

Connecting to Trust Payments uses API credentials. The integration uses a combination of
the Trust Payments Web Services API and JavaScript, so you will create a Web
Services user and obtain JavaScript credentials in the Trust Payments dashboard,
then enter those details in the setup screen.

## Setup

1. On your Trust Payments dashboard, open **Sites** and confirm the site you want
   to connect is listed. Note down its `sitereference` — you will enter this in
   the setup screen as **Site Reference**.

   ![Trust Payments dashboard - Sites screen showing the Manage sites list](/_astro/cdn/92629dd74f/connect-1.png)

2. Open **Users** and select **Add user** to create a Web Services user.

   ![Trust Payments dashboard - Users screen with the Add user button](/_astro/cdn/5f941f48fe/connect-2.png)

3. Complete the Web Services user details:

   - **Username:** ws_shuttle
   - **Display name:** Shuttle
   - **Email:** your email
   - **Password:** choose a password
   - **Role:** Webservices
   - **Valid IP:** 52.51.86.26, 54.229.12.118, 54.76.31.104, 34.252.246.134
   - **Role if invalid IP:** Prevent Login
   - **Allocated sites:** make sure your site is listed here

   Shuttle Global is the integration platform that connects your payment provider to the software you use to take payments.

   :::note[Tip]
   If you cannot select your site under **Allocated sites**, ask Trust Payments to configure this for you.
   :::

   Note down:

   - `username` as **WebServices API Username**
   - `password` as **WebServices API User Password**

   ![Trust Payments dashboard - Add user form with the Allocated sites field highlighted](/_astro/cdn/79a147877f/connect-3.png)

4. Ask Trust Payments to create your JavaScript credentials — these are required
   for ecommerce payments. Note down:

   - `username` as **JS API Username**
   - `password` as **JS API Secret**

## Configuring the connection

5. Using the details above, create the Trust Payments connection. Enter
   the Site Reference, WebServices API Username and Password, and the JS API
   Username and Secret.

   ![New Gateway setup form for Trust Payments](/_astro/cdn/7baf37b4a2/connect-4.png)

6. When you save, a number of extra fields appear:

   - **Require address (AVS):** require the customer to enter their billing address.
   - **Tokenisation Currency:** your primary currency, used when tokenising cards
     outside of a transaction.

   ![Gateway Settings showing a connected Trust Payments gateway](/_astro/cdn/8319523b21/connect-5.png)

## Enabling webhooks

To ensure the integration operates correctly you need to set up webhooks — the way
Trust Payments notifies the integration of updates. Using the **Webhook Url** shown in the
gateway settings, configure Trust Payments as follows.

1. Open the Trust Payments dashboard, select **Sites** and your site, then open
   **Rule manager**.

   ![Trust Payments dashboard - Site details with the Rule manager tile](/_astro/cdn/745d1bb2c5/connect-6.png)

2. Where it says "To get started, select an action type:", select **URL
   notification**.

   ![Trust Payments dashboard - Rule manager with the URL notification action type](/_astro/cdn/8c1c35d41f/connect-7.png)

3. Select **Add new action**.

   ![Trust Payments dashboard - Rule manager with the Add new action button](/_astro/cdn/137317f1b0/connect-8.png)

4. Configure the action:

   - **Name:** Send notification to Shuttle
   - **Use Site Security Details:** No
   - **Security Algorithm:** sha256
   - **Notification Password:** choose a password
   - **Pipe notification to browser:** No
   - **Process Notification:** Online
   - **Website address:** the Webhook Url shown in the gateway settings — typically
     `https://app.shuttleglobal.com/b/TRUST/webhook`
   - **Method:** POST
   - **Fields:** sitereference, transactionreference, errorcode, requesttypedescription

   Note down the Notification Password as **Webhook Password**.

   ![Trust Payments dashboard - URL notification action configuration form](/_astro/cdn/9624cdf52c/connect-9.png)

5. Complete creating the rule and make sure it is **Active**:

   - **If:** a completed request matched "All Requests"
   - **Then:** Send notification to Shuttle

6. Enter the Notification Password as **Webhook Password** in the gateway settings. We test the
   webhook — this takes about two minutes and shows one of the following statuses:

   - **UNVERIFIED:** we have not received anything. Double check your Trust Payments
     setup, especially the Web Services user (role and IP addresses) and the webhook
     notification settings.
   - **UNSIGNED:** we received a webhook but the Webhook Password was missing or
     incorrect.
   - **VERIFIED:** it is set up correctly.