Skip to content
PrestaShop · User manual

Swish för handel for PrestaShop

Version 2.5.0 Product page
Chapter 6

Merchant certificate

How to install the Swish merchant certificate, create a certificate request in the module, renew it before it expires, and check the setup with the diagnostics.

Why a certificate is needed

Swish identifies your shop by a client certificate issued for your merchant number. The module uses it for every call to Swish: payments, status checks and refunds. Without a valid certificate you cannot enable payments in Official MSS test or Production.

The Merchant certificate tab shows the installed certificate, with its expiry date (expires) and fingerprint, or No certificate uploaded.

Option 1: upload a PKCS#12 file

Use this if you already have the certificate and its private key in a .p12 or .pfx file, for example the MSS test certificate.

  1. In PKCS#12 (.p12) choose the file. It can be up to 256 KiB.
  2. Type the file's password in Certificate password.
  3. Press Upload certificate.

The module checks the password, that the certificate matches its private key and that it is not expired. It then stores it and selects it for the shop. The password field is cleared after the upload.

Option 2: guided certificate setup and renewal

With this option the private key is created on your server and never leaves it. Only the certificate request (CSR) goes to Swish.

  1. Make sure your number is in Swish merchant number in General settings.
  2. Open Guided certificate setup and renewal.
  3. Type your company name as registered with your bank in Registered company name.
  4. Press Generate CSR. The request appears in the CSR box.
  5. Sign in to Swish Certificate Management with your own BankID and request a new certificate in PEM format, pasting the content of the CSR box.
  6. Copy the certificate chain that Swish issues and paste it into Issued PEM certificate chain.
  7. Press Install issued certificate. The module checks that it matches the private key and selects it.

If you leave the page between steps 4 and 6, press Load current CSR to show the pending request again. The authorisation in Swish Certificate Management is always done by you with your BankID; the module cannot do it for you.

Renewing the certificate

Swish certificates expire. Setup diagnostics warns you with Renew your certificate soon. when 30 days or fewer remain. Renew with the guided setup or by uploading a new .p12 file, as above.

Each installation creates a new certificate generation. Earlier generations are kept, so payments that started with the old certificate can still be completed and refunded.

Where certificates are stored

Certificates are stored in a private folder outside your shop's public web folder, with access limited to the shop's PHP user. By default the module uses a folder private/devman-swish next to your shop folder and creates it if the server allows.

If the module reports Create a writable private certificate directory outside the web root and set DEVMAN_SWISH_PRIVATE_DIR., ask your hosting provider to:

  1. create a folder outside the public web directory, writable only by the PHP user of the shop;
  2. set the server environment variable DEVMAN_SWISH_PRIVATE_DIR to its full path.

A folder inside the shop's public folder, such as modules/, is refused.

Setup diagnostics

The Setup diagnostics tab checks your configuration before you go live.

Run diagnostics lists each check with ✓ when it passes and ! when it needs attention:

CheckWhat it verifies
curl, openssl, mbstringThe PHP extensions are available.
HTTPS callback configurationYour shop's address uses HTTPS on port 443, which Swish needs to send payment updates.
Swish merchant numberA valid merchant number is saved.
SEK currency enabledThe Swedish krona exists and is active in your shop.
Merchant certificateA valid certificate is installed, with the days remaining before it expires.

Under the checks, Payments needing review shows how many payments are waiting for your review. See Checkout and payments.

Test bank connection without a payment connects to Swish with your certificate. Bank connection verified. No payment was created. means the certificate and the environment work.

The diagnostics cannot prove that Swish can reach your shop from the internet. If payments stay pending after the customer has paid, check your firewall and hosting rules for incoming HTTPS requests. See Troubleshooting.

Still need help?

Open a support ticket from your account and our team will look at your store with you.