Open Banking in Sweden

Overview

Open Banking in Sweden is an online banking payment method that uses open banking APIs to expand the capabilities of secure handling and sharing customers’ financial data. This payment method belongs to the group of Open Banking methods and allows processing payments in kronor via the banks of Sweden.

General information

Payment method type bank payments
Payment instruments
  • bank accounts
  • payments cards
Countries and regions SE
Payment currencies SEK
Currency conversion on the ecommpay side
Purchases +
Payouts
Stored credentials payments
Full refunds
Partial refunds
Chargebacks
Special considerations
  • Payment Page supports different bank selection options
  • opening the payment forms of the provider and bank services is not available in an iframe element
Obtaining access to the payment method and access fee refer to your ecommpay key account manager

Interaction diagram

Payment processing by using the Open Banking in Sweden payment method requires merchant's web service, one of the interfaces and the payment platform of ecommpay, as well as one of the bank services which supports this payment method.



Operations support

  Interfaces Amounts Timespans **
Payment Page CMS Plug-ins Gate Dashboard minimum maximum basic time threshold time
Purchases + + * * * *

* Amount limits and payment processing times depend on banks.

** The basic and threshold times are defined as follows:

  • The basic time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the information about the payment result is sent to the initiator. The basic time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (where customer effort is required). You can use the basic time to define the moment of reacting to the absence of payment result callbacks or checking payment status.
  • The threshold time is the maximum possible time from the moment a payment is initiated in the payment platform to the moment the information about the payment result is sent to the initiator. A payment is automatically declined, if its waiting time exceeds the threshold time. For individual setting of the threshold time limit, contact ecommpay technical support.

Processing scenarios

In the Open Banking in Sweden method, to perform a purchase operation, you need to redirect a customer to the provider service.

Supported banks

Payment processing involving the Open Banking in Sweden method is carried out through banks that support the use of this method. Usually, when Payment Page is used, the bank is selected by customer in the payment form. However, if Payment Page is opened with preselected method and bank, or if the payment is initiated through Gate, the bank should be selected by customer on the web service side and you need to specify the ID of the selected bank in requests for payment processing.

The table below provides information about the names and IDs of the supported banks. This information is for reference only.

Table 1. List of banks
Bank ID
Nordea Bank 5121
Svenska Handelsbanken 5151
Swedbank 5161
DNB 55411
Alandsbanken 55401
Danske Bank 55391
SEB 55381

As the list of the supported banks may change, for the most recent information it is recommended to send request to /v2/info/banks/sweden/sale/list by using POST (HTTP) method. This endpoind belongs to the endpoind group /v2/info/banks/{payment_method}/{operationType}/list of Gate API. The request must include project and payment IDs, amount and currency of the payment, and signature. It is recommended to fill in the real payment information, but you can also specify random values.

Figure: Example of data in the request for obtaining the list of banks

{
    "general": {
        "project_id": 200,
        "payment_id": "ORDER_155860015",
        "signature": "K6jllym+PtObocZtr345st...=="
    },
    "payment": {
        "amount": 1000,
        "currency": "EUR"
    }
}

Figure: Example of data in response with information about the banks

[
  {
    "id": 5121, // Bank ID
    "abbr": "NORDEA-SWEDEN", // Bank abbreviation (for internal use)
    "name": "Nordea Bank", // Official bank name
    "nativeName": "Nordea Bank", // Local bank name
    "currencies": [ // Array with information about the currencies supported by the bank
      {
        "id": 978, // Currency ID in the payment platform
        "alpha_3_4217": "EUR", // Alphabetic code of the payment currency in ISO-4217 alpha-3 format
        "number_3_4217": "978", // Numeric code of the payment currency in ISO-4217 alpha-3 format
        "exponent": 2 // The number of minor units of the currency
      }
    ]
  },
  {
    "id": 5161,
    "abbr": "SWEDBANK-SWEDEN",
    "name": "Swedbank",
    "nativeName": "Swedbank",
    "currencies": [
      {
        "id": 978,
        "alpha_3_4217": "EUR",
        "number_3_4217": "978",
        "exponent": 2
      }
    ]
  },
  {
    "id": 55401,
    "abbr": "ALANDSBANKEN",
    "name": "Alandsbanken",
    "nativeName": "Alandsbanken",
    "currencies": [
      {
        "id": 978,
        "alpha_3_4217": "EUR",
        "number_3_4217": "978",
        "exponent": 2
      }
    ]
  }
]

The sections that follow provide detailed information about what you need to perform payments and how you can analyse the information on payments and operations.

Purchase by using Payment Page

General information

In the Open Banking in Sweden method, to perform a purchase by using Payment Page, the merchant web service should send a request with all the required parameters and signature to the ecommpay URL and get the callback with information about the payment result from the payment platform. When opening Payment Page, you can either allow your customer to select the Open Banking in Sweden method from the list of other payment methods on Payment Page or have Payment Page opened with the Open Banking in Sweden method selected. For more information about preselecting payment methods, see in Preselecting payment methods.



Figure: Purchase processing by using Payment Page: Step-by-step description

  1. A customer initiates a purchase on the merchant's web service.
  2. The web service sends the request for Payment Page opening to the specified ecommpay URL.
  3. The request for opening is redirected to the payment platform.
  4. The payment platform performs the initial request processing that involves validation of the required parameters and signature.
  5. In the ecommpay payment platform Payment Page is generated based on the project settings and parameters specified in the request.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Open Banking in Sweden method and one of the supported banks.
  8. The request for processing the payment is sent from Payment Page to the payment platform.
  9. The payment platform performs the internal processing of the purchase request.
  10. The data for redirecting the customer to the provider service is sent from the payment platform to Payment Page.
  11. The customer is redirected to the provider service and then to the bank service where payment instruction is displayed to the customer.
  12. The customer completes all the required payment steps.
  13. The payment is processed on the side of the bank service.
  14. The information about the result is displayed to the customer on the side of the bank service.
  15. The customer is redirected to Payment Page.
  16. The bank service sends the notification about the result to the provider service.
  17. The provider service sends the notification about the result to the payment platform.
  18. The payment platform sends a callback with information about the payment result to the web service.
  19. The payment platform sends information about the result to Payment Page.
  20. A page with information about the payment result is displayed to the customer on Payment Page.

The sections that follow discuss in more details the request format and the Payment Page parameters to use in the Open Banking in Sweden payment method and provide the information on the format of callbacks with payment results. For the general information on how to use the API, see Payment Page API Description.

Request format

There are several things you need to consider when using the Open Banking in Sweden method:

  1. You must provide values for the basic minimum of parameters. Listed below are the parameters that are mandatory for any payment method:
    • project_id—the project ID obtained from ecommpay
    • payment_id—payment ID unique within the project
    • payment_currency—payment currency in ISO-4217 alpha-3 format
    • payment_amount—purchase amount in minor currency units
    • customer_id—the unique ID of the customer within your project
  2. To preselect the Open Banking payment method group, specify the openbanking group code in the force_payment_group parameter.
  3. You can customise the selecting payment method page on Payment Page.

    By default, the banks are grouped in one Swedish banks button on Payment Page, so the selection of a bank is carried out in two steps. First, the Open Banking in Sweden method is chosen among others, and then the bank is selected on the next page with the list of the banks.

    There are several options for displaying the page with the selecting of payment method on Payment Page:

    • To display banks grouped in one Swedish banks button on Payment Page in the list of payment methods.
    • To display only one Swedish banks button without other payment methods. To preselect Open Banking in Sweden as the payment method on Payment Page, pass the code online-swedish-banks in the force_payment_method parameter. The list of the banks from Open Banking in Sweden group with separate buttons are displayed to a customer on Payment Page bypassing the page with the payment method selection.
    • To display the banks with separate buttons in the list of payment methods. You need to pass true in the split_banks parameter in the request for opening in the payment_methods_options string.
      "payment_methods_options": "{\"online_swedish_banks\": {\"split_banks\": true}}"
      
    • To display a button of a specific bank (one or several) from Open Banking in Sweden group on Payment Page in the list of payment methods, pass the bank identifier in the banks_id parameter. If it is necessary to display several banks from a group, pass the identifiers of these banks separated by a comma with a space.
      "payment_methods_options": "{\"online_swedish_banks\": {\"split_banks\": true, \"banks_id\": [5161, 5151]}}"

      Here is the example of a request for opening Payment Page with preselected payment method and a bank.

      Figure: Example of the request with preselecting the payment method and a bank

          { 
            payment_id: '580', 
            payment_amount: 1000, 
            payment_currency: 'EUR', 
            project_id: 120,
            force_payment_method: 'online-swedish-banks',
            payment_methods_options: '{\"online_swedish_banks\": {\"banks_id\": [5161]}}',
            customer_id: 'customer1',
            signature: "XFyr/D1zXj84lUZVfpbWZol9JAZLnUZoPJKPXRbOqBUpxxa/hOKm2
                                  P8XOqydoyeIi7KdqrcxLFd3GxgPgUzIDg==
          }
  4. If required, you can also add any other additional parameters Payment Page supports.
  5. After you specify all the parameters you need, you must create the signature for the request. For instructions on how to sign a payment request, see Signature generation and verification.

Thus, a correct payment request in the Open Banking in Sweden method must include project, customer, and payment IDs, the currency and the amount of a payment, as shown in the following example:

    { 
      payment_id: 'X03936', 
      payment_amount: 1000, 
      payment_currency: 'EUR', 
      project_id: 123, 
      customer_id: 'customer1',
      signature: "kUi2x9dKHA...\/RLCvhtT4DqtVUkDJrOcZzUCwX6R\/ekpZhkIQg=="
    }

For information about all parameters available in the Open Banking in Sweden method, see Parameters for opening payment form.

Callback format

The Open Banking in Sweden method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 10.00 EUR purchase made in the 239 project.

Figure: Example of callback data indicating that the purchase has been processed

 {
        "project_id": 239,
        "payment": {
            "id": "ABC12345",
            "type": "purchase",
            "status": "success",
            "date": "2020-11-03T14:41:38+0000",
            "method": "Swedish Banks",
            "sum": {
                "amount": 1000,
                "currency": "EUR"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 77796010023511,
            "type": "sale",
            "status": "success",
            "date": "2020-11-03T14:41:38+0000",
            "created_date": "2020-11-03T14:39:34+0000",
            "request_id": "4727897a23d96203f784...d22c87a7f4f473d93-00077797",
            "sum_initial": {
                "amount": 1000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "EUR"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 3901,
                "payment_id": "t:5nFu358iuKC3vz8g...zQLtgSSoyAQubVf",
                "auth_code": ""
            }
        },
        "signature": "8UuSBBDvR9RlVXJR+3A3JeYOOPhf...1VlLygAOq+NPNKLu37IZ0kw=="
    }

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

 {
        "project_id": 10801,
        "payment": {
            "id": "ABC67890",
            "type": "purchase",
            "status": "decline",
            "date": "2020-11-03T15:47:39+0000",
            "method": "Swedish Banks",
            "sum": {
                "amount": 1000,
                "currency": "EUR"
            },
            "description": ""
        },
        "customer": {
            "id": "customer2"
        },
        "operation": {
            "id": 92939010024021,
            "type": "sale",
            "status": "decline",
            "date": "2020-11-03T15:47:39+0000",
            "created_date": "2020-11-03T15:47:02+0000",
            "request_id": "2973231f346e408fcf62f1e3388a...3971c8ccb13-00092940",
            "sum_initial": {
                "amount": 1000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "EUR"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 3901,
                "payment_id": ""
            }
        },
        "signature": "GK7q/MHaYQuUqSQiCzWFi.../6UzJhblNPSr7tj1/PWfWgCJLbnaeg=="
    }

Useful links

The following articles can be useful when implementing purchases via Payment Page:

Purchase by using Gate

General information

In the Open Banking in Sweden method, when processing a purchase by using Gate, the merchant web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Redirect the customer to the provider service.
  3. Get the callback with information about the payment result from the payment platform.

The following diagram provides the detailed picture of the payment processing procedure.



Figure: Purchase sequence by using Gate: Step-by-step description

  1. A customer initiates a purchase through one of the Open Banking in Sweden group banks on the merchant's web service side.
  2. The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request for processing the purchase from Gate.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends the response with confirmation of request receipt and correctness check result to the web service. For more information, see Response format.
  6. The payment platform performs the internal processing of the purchase request.
  7. The data for redirecting the customer to the provider service is sent from the payment platform to the web service.
  8. The customer is redirected to the provider service, and then to the bank service, where payment instruction is displayed to the customer.
  9. The customer completes all the required payment steps.
  10. The payment is processed on the side of the bank service.
  11. The information about payment result is displayed to the customer on the side of the bank service.
  12. The customer is redirected to the web service.
  13. The bank service sends the notification about the result to the provider service.
  14. The provider service sends the notification about the result to the payment platform.
  15. The payment platform sends a callback with information about the payment result to the web service.
  16. The customer receives information about payment result on the web service side.

The sections that follow discuss in more details the request format and the Gate parameters to use in the Open Banking in Sweden payment method and provide the information on the format of callbacks with purchase results.

Request format

There are several things you must consider when using purchase requests in the Open Banking in Sweden method:
  1. You perform purchase by sending request to /v2/payment/banks/sweden/sale by using POST (HTTP) method. This is an online banking request group: /v2/payment/banks/{payment_method}/sale
  2. The following objects and parameters must be specified in the request:
    • Object general—general request identification information:
      • project_id—the project ID obtained from ecommpay
      • payment_id—payment ID unique within the project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification.
    • Object payment—purchase information:
      • amount—purchase amount in minor currency units
      • currency—purchase currency in ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—the unique ID of the customer within your project
      • ip_address—customer IP address
    • Object account—customer account information:
      • bank_id—bank identifier
    • Object return_url—URLs for redirecting a customer from the bank website:
      • success—URL for redirecting a customer after a successful purchase
      • decline—URL for redirecting a customer after a declined purchase
      • return—URL for redirecting a customer during any step of the purchase
  3. If required, you can also add any other additional parameters Gate supports.

Thus, a correct payment request through the Open Banking in Sweden method must include project, payment, customer and bank IDs, customer IP-address, signature, currency and amount of the purchase, and URL for redirection, as shown in the following example:

Figure: Example of a purchase request

{
    "general": {
      "project_id": 2990,
      "payment_id": payment_id,
      "signature": "PJkV8ej\/UG0Di8hTng6JvC7vQsaC6tajQVVfBaNIipTv+AWoXW\/9MTO8yJA=="
    },
    "payment": {
      "amount": 1000,
      "currency": "EUR"
      },
    "customer": {
      "id": "customer1",
      "ip_address": "1.1.1.1"
    },
    "account":{
      "bank_id": 5161
    },
    "return_url":{
      "return": "http://example.com/return"
 }
}

Formats of the customer redirection data

In the Open Banking in Sweden method, to redirect a customer to the provider service, it is required to do the following:

  1. Receive the callback from the payment platform which includes the redirect_data object. This object contains the object body with the data necessary to reference the provider's JavaScript library and call the function that redirects the customer to the provider website.
  2. Reference provider's JavaScript library using the URL received in the widget_url parameter of the body object.
  3. Call the function that redirects the customer to the provider website using the parameters received in the body object (according to the provider requirements).

The body object contains the following mandatory parameters:

  • widget_url—URL of provider's JavaScript library
  • widget_host—hostname of the provider server
  • token—token which is used in data.token in the function that redirects the customer
  • other—determines the possibility of payment by using banks that are not supported by default on the provider side; this option is not supported in this technical implementation, the value of the parameter is always off
  • callback_url—URL for customer redirection to the web service side after successful payment

The body object can also contain the following optional parameters:

  • creditor—bank identifier code (BIC); the parameter is used when the bank is selected on the web service side
  • css—link to the CSS file with styles which allows the merchant to alter the appearance of the provider website
  • default_country—code of the country with the banks which are available for payment processing; the code must be specified in the ISO 3166-1 alpha-2 format

The following is the example of callback with customer redirection data.

Figure: Example of customer redirection data

"redirect": {
        "method": "POST",
        "url": "http://pay.test/example",
        "body": {
          "widget_url":"https://psd2.neopay.lt/widget.js",
          "widget_host":"https://psd2.neopay.lt/",
            "token": "eyJhbGciOiJIUzI1NiIsInR5cCIp0cnVlLCJpYXQiOjE0OTMyMD",
            "other": "off",
            "creditor": "XXXYYY12",
            "css": "https://css.test.org",
            "default_country": "SE",
            "callback_url": "https://callback.url.org"
    }
    }

The following is the example of the URL which is used to reference the provider's JavaScript library and the example of call of the function which redirects the customer the provider website. Both of these examples are based on the example of customer redirection data provider above.

Figure: Example of URL of provider's JavaScript library

<script type="text/javascript" src="https://psd2.neopay.lt/widget.js"></script>

Figure: Example of call of the function which redirects the customer to the provider website

var NEOWidgetHost = "https://psd2.neopay.lt";
NEOWidget.initialize(
    NEOWidgetHost,
    data.token,
    {
    'other':'off',
    'creditor': 'XXXYYY12',
    'css':'https://css.test.org',
    'default_country':'SE',
    'callback_url':'https://callback.url.org'
    }
); 

Final callback format

The Open Banking in Sweden method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 10.00 EUR purchase made in the 239 project.

Figure: Example of callback data indicating that the purchase has been processed

 {
        "project_id": 239,
        "payment": {
            "id": "ABC12345",
            "type": "purchase",
            "status": "success",
            "date": "2020-11-03T14:41:38+0000",
            "method": "Swedish Banks",
            "sum": {
                "amount": 1000,
                "currency": "EUR"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "operation": {
            "id": 77796010023511,
            "type": "sale",
            "status": "success",
            "date": "2020-11-03T14:41:38+0000",
            "created_date": "2020-11-03T14:39:34+0000",
            "request_id": "4727897a23d96203f784...d22c87a7f4f473d93-00077797",
            "sum_initial": {
                "amount": 1000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "EUR"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 3901,
                "payment_id": "t:5nFu358iuKC3vz8g...zQLtgSSoyAQubVf",
                "auth_code": ""
            }
        },
        "signature": "8UuSBBDvR9RlVXJR+3A3JeYOOPhf...1VlLygAOq+NPNKLu37IZ0kw=="
    }

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

 {
        "project_id": 10801,
        "payment": {
            "id": "ABC67890",
            "type": "purchase",
            "status": "decline",
            "date": "2020-11-03T15:47:39+0000",
            "method": "Swedish Banks",
            "sum": {
                "amount": 1000,
                "currency": "EUR"
            },
            "description": ""
        },
        "customer": {
            "id": "customer2"
        },
        "operation": {
            "id": 92939010024021,
            "type": "sale",
            "status": "decline",
            "date": "2020-11-03T15:47:39+0000",
            "created_date": "2020-11-03T15:47:02+0000",
            "request_id": "2973231f346e408fcf62f1e3388a...3971c8ccb13-00092940",
            "sum_initial": {
                "amount": 1000,
                "currency": "EUR"
            },
            "sum_converted": {
                "amount": 1000,
                "currency": "EUR"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 3901,
                "payment_id": ""
            }
        },
        "signature": "GK7q/MHaYQuUqSQiCzWFi.../6UzJhblNPSr7tj1/PWfWgCJLbnaeg=="
    }

Useful links

The following articles can be useful when implementing purchases via Gate:

Analysis of payments results

As with other payment methods ecommpay offers, when using the Open Banking in Sweden method, you have several options to analyse the information about payments and operations performed by using the method—alone or in conjunction with other methods.

You can load and analyse all the necessary information in Dashboard, for instance you can use the analytic panels on the Analytics tab to this end.

Also, you can export the information for further analysis by using third party analytical tools. The following options are available:

  • Dashboard allows you to download reports in CSV and XLS formats—by using the tools on the Payments tab. You can perform export as a one-time download to your local computer or have payment data regularly exported and delivered to email addresses you specify.
  • Data API allows you to have payment information exported in JSON format and delivered to a URL you specify. The payment information is exported by using the /operations/get queries.

If you have any further questions regarding payment data analysis, contact ecommpay technical support.