# Configuring Swish

[Swish](https://www.swish.nu/) mobile payments are popular option in Sweden.  FinDock integrates with the Swish service to initiate and collect payments in Swedish Krona.

| [Multi-merchant](/docs/payment-processors/multi-merchant-accounts-for-psps) | [Multi-currency](/docs/payment-processors/multiple-currency-support-in-findock) |
|  --- | --- |
|  |  |


| Payment Method | [Online Payment Flow](/docs/payments/accepting-payments-with-findock#online-payment-collection) | [Integration Patterns](/docs/payments/accepting-payments-with-findock#online-integration-patterns) | [Data Entry](/docs/payments/accepting-payments-with-findock#data-entry) | One-time | Recurring | [Refunds](/docs/payment-processors/payment-methods/payment-methods-overview#refunds) |
|  --- | --- | --- | --- | --- | --- | --- |
| [Swish](/docs/payment-processors/payment-methods/swish) | Online Redirect | API | No |  |  |  |


**Prerequisites**

* FinDock installed and configured.
* WebHub is connected.
* You have a Swish merchant account.
* FinDock is declared a technical supplier at your Swedish bank. Please note FinDock has two identifications. For test environments, use TS Number 9871479904. For production, use TS Number 9871800083.


## Install the Swish extension

Follow the standard procedure for [installing payment processors](/docs/setup/add-payment-extensions) to add the Swish payment extension and activate the Swish payment method.

Check and assign the [required permissions](/docs/setup/general-permission-guidance). If you are using custom permission set groups, ensure the [package-specific permission sets](/docs/setup/permission-set-groups#swish-permission-sets) are assigned.

## Configure the Swish extension

To configure Swish for FinDock:

1. Launch the FinDock app and click the **FinDock Setup** tab.
2. Click **Processors & Methods** in the left-hand menu.
3. On the **Installed** tab, click the Swish processor entry.
4. On the **Accounts** tab, click **Add account**.
5. For the merchant account you want to integrate, add the following details:
  * **Merchant Account Name**: Enter a name for your Swish target (merchant account)
  * **Default Account**: Enable on the account you want used when no account is specified in a payment intent call to the Payment API
  * **Test Account**: Enable if you are setting up a test environment
  * **Payee Number**: Enter your Swish alias (123 XXX YYYY)
6. Click **Save**.


## Swish data mapping

The table below summarizes the payment data FinDock captures to manage Swish transactions.

| Swish data | Object | Field | Value/Description |
|  --- | --- | --- | --- |
| N/A | Payment Profile | Record Type | Wallet |
| N/A | Payment Profile | Wallet Type | Swish |
| payer.alias | Payment Profile | Wallet Id | Payer's mobile phone number |
| consentID | Mandate | Mandate Id | Recurring payment authorization Id |


## Testing Swish

When testing Swish, make sure you use a target that is set up as a test target. In addition, you need to use a special test configuration of the [BankID](https://www.bankid.com/) app as well as a Swish test app. For both, you need use the same civic identity number. You can use your own or [Swish test data](https://swedish.identityinfo.net/personalidentitynumber/testdata).

To set up a BankID app for testing:

1. Download the BankID security app from your respective mobile app store.
2. Configure the app to use the BankID testing environment [as instructed here](https://www.bankid.com/en/utvecklare/test/skaffa-testbankid/testbankid-konfiguration).
3. Create a test account according to the [test BankID instructions](https://www.bankid.com/en/utvecklare/test/skaffa-testbankid/test-bankid-get).


For the Swish app, you need to install a test version that is separate from the normal production app. Download and install the test app from one of the links below:

* [Swish test app for Android](https://appdistribution.firebase.dev/i/6e190185a34cb2f3)
* [Swish test app for iOS](https://testflight.apple.com/join/iQTsRg5b)


If you are using iOS, make sure to change the BankID server setting to point to the test environment as instructed.

In addition, you need to get a Swish test number to enable testing in sandboxes. Contact Swish technical support (tekniksupport@getswish.se) and request a test user and 123-number, using the FinDock Technical Supplier number for test environments (see prerequisites above) as your reference.

### Payment API test messages

You can use the following example message with the Payment API to check if your Swish configuration.

For a one-time payment:


```json
{
    "SuccessURL": "https://www.example.com/success",
    "FailureURL": "https://www.example.com/error",
    "Payer": {
        "Contact": {
            "SalesforceFields": {
                "FirstName": "Test",
                "LastName": "Payer",
                "Email": "test@findock.com"
            }
        }
    },
    "OneTime": {
        "Amount": "36"
    },
    "PaymentMethod": {
        "Name": "Swish",
        "Processor": "Swish-for-FinDock"
    }
}
```

For a recurring payment:


```json
{
    "SuccessURL": "https://www.example.com/success",
    "FailureURL": "https://www.example.com/error",
    "Payer": {
        "Contact": {
            "SalesforceFields": {
                "FirstName": "Test",
                "LastName": "Payer",
                "Email": "test@findock.com"
            }
        }
    },
    "Recurring": {
        "Amount": "10",
        "Frequency": "Monthly",
        "StartDate": "2025-03-01",
        "Description": "Monthly subscription fee"
    },
    "PaymentMethod": {
        "Name": "Swish",
        "Processor": "Swish-for-FinDock"
    }
}
```