# Cardknox

In this step you will  create one **External credentials**, and  create three Named credentials.

{% hint style="warning" %}
Important: When creating your credentials, use the exact spelling and capitalization indicated and follow the credential creation and Flow run in order.
{% endhint %}

## Retrieve or create your API keys from the Gateway

You will need 2 keys. Copy these to a separate document so you can reference them in a later step.

* An Ifields Key Key (you will use this key as is)
* An API Key

<figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2Fx7u0KTsRNn6HPZcUwN0U%2FSCR-20250116-eut-2.png?alt=media&#x26;token=e0faa7d6-892c-4e02-ac2a-7dfb81c93b83" alt=""><figcaption></figcaption></figure>

### External Credentials

To create the first credential:

1. Navigate to Setup > Named Credentials.
2. Click the External Credentials tab.
3. Click New.
4. Enter the following values:
5. Label and Name: cardknoxExternal
6. Authentication Protocol: Custom
7. Click Save.&#x20;
8. In the credential record, scroll down to locate the Principals section and click New to create a new Principal record.<br>

   <figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2FiAp3Awa1JgyHTMGbjrUQ%2FSCR-20250116-ew9-2.png?alt=media&#x26;token=6ad7e91d-ac19-4a7e-ac62-3e7c5d697eb9" alt=""><figcaption></figcaption></figure>

Add the following values:

1. Parameter name: keys
2. Sequence Number: 1
3. Add New Authentication Parameter
   1. Name: ifields
   2. Value:  your ifield API key
4. Add a second New Parameter

   1. Name: key
   2. value: your API key

   <figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2FVPk7L19z37PEDY9dBvwh%2Fimage.png?alt=media&#x26;token=993b598b-78dc-4153-9b03-a965ec551480" alt=""><figcaption></figcaption></figure>
5. Click Save.<br>

### Named Credentials

From Setup, navigate to Named Credentials.&#x20;

In the Named Credentials tab:

1. Click New and complete the following field values:
2. 1. Label and Name: ‘cardknoxPaytram’.
   2. URL field: <https://gateway.paytram.io/>
   3. Enabled for Callouts: true.
   4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
   5. Select all Callout Options.
   6. Allowed Namespaces for Callouts: ‘paytram’.<br>

      <figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2Fk0lXb2fqp45BB1qlGKPD%2Fimage.png?alt=media&#x26;token=7f9dc6aa-b729-4e33-9fb2-c6b04d3e07af" alt=""><figcaption></figcaption></figure>
3. Click Save.&#x20;

#### Now create the second Named credential.&#x20;

1. Click New and complete the following field values:
2.

```
1. Label and Name: ‘cardknoxV2’.
```

```
2. URL field: https://api.cardknox.com/v2
3. Enabled for Callouts: true.
4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
5. Select all Callout Options.
6. Allowed Namespaces for Callouts: ‘paytram’.

<br>

<figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2FM0VwPuoOtIQdqOmk8bVO%2Fimage.png?alt=media&#x26;token=a822fc95-7587-47f0-ad07-af9763a98d2d" alt=""><figcaption></figcaption></figure>
```

3\. Click Save.&#x20;

#### Now create the third Named credential.&#x20;

1. Click New and complete the following field values:
2.

```
1. Label and Name: ‘cardknoxV1’.
```

```
2. URL field: https://x1.cardknox.com/
3. Enabled for Callouts: true.
4. For the External Credential, select the ‘cardknoxExternal’ credential you previously created.
5. Select all Callout Options.
6. Allowed Namespaces for Callouts: ‘paytram’.

<br>

<figure><img src="https://3963923104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDloOn8rXTBChTmzNkgG%2Fuploads%2FcDq2fVYY6xVQGqvNwFsd%2Fimage.png?alt=media&#x26;token=8da755a2-cf83-4994-a4b8-ca9a5c06ff06" alt=""><figcaption></figcaption></figure>
```

3\. Click Save.&#x20;

## Adjust Session Settings

Navigate to Setup > Session Settings and ensure the the 'Use Lightning Web Security for Lighning web components and Aura components' is checked. Click Save.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfLHSYbobZZH-HkzQtARXznv6Isih6SHXp3TA-L83HcxrcZJb3lcyMuOzDA5NMDT13o0TLOAA-B6Er-dpOPxwEfs_jWT8AQkSwJFdEkjGx0Zwcsv5hd8eNGDkl-5Y6JUmKYB62bQ1-NasQ9tSfG9SRAlRqq?key=rwnBD_Kw1Bk1n8yZFuCJcQ" alt=""><figcaption></figcaption></figure>

## Permissions

Continue to set [permissions](https://fast-track-digital.gitbook.io/paytram-documentation/initial-setup/permissions-all-gateways)&#x20;
