Swish certificates
Before the extension can take live payments you need a Swish för handel agreement, your Swish number, and a client certificate with its private key. This chapter outlines the steps.
Why a certificate is needed
Swish accepts payment requests only from merchants that identify themselves with a client certificate issued by Swish. The extension sends every payment and refund request with your certificate and private key. Without both files your store cannot create Swish payments.
1. Get Swish för handel from your bank
Contact your bank and ask for "Swish för handel". The bank handles the paperwork with Bankgirot. When the service is approved you are notified, and you receive a new Swish number, usually starting with 123. This number is the one you enter in Swish Number in the settings. It is used only for the integration and is not shown to customers.
2. Create a private key and a certificate request
The certificate is requested with a CSR (certificate signing request), which you create together with your private key. On a Linux computer or server with OpenSSL, one command creates both files:
openssl req -new -newkey rsa:4096 -nodes -keyout swish_priv_key.key -out swish.csrswish_priv_key.keyis your private key. Keep it safe and never share it.swish.csris the request you paste into the Swish certificate portal. Keep it too: you can use it again when the certificate expires and you want to keep the same key.
3. Request the certificate from Swish
- Sign in to the Swish certificate management portal at comcert.getswish.net.
- Open the New certificate tab.
- Paste the full contents of
swish.csrinto the text area. - Choose the format PEM and press Generate.
- Save the certificate that Swish shows to a text file on your computer with the extension
.crt, for exampleswish_certificate.crt. Copy it exactly, without extra characters or empty lines.
The certificate list in the portal shows the validity of each certificate. Request a new one before it expires.
4. Upload both files to the extension
- Open the extension and go to the General tab.
- In Certificate file .crt, choose your
.crtfile. - In Key file .key, choose your
.keyfile. - Press Save.
The extension accepts only files that end in .crt and .key respectively. Below each field you see Certificate file exist or Private key file exist when the file is in place, and Certificate file doesn't exist or Private key file doesn't exist when it is missing.
The files are stored in system/library/swish_certificates/ in your store, a folder that is protected against access from the web. When you renew the certificate, upload the new file in the same way. It replaces the old one.
Testing without your own certificate
When Test mode is on, the extension connects to the Swish test environment (Merchant Swish Simulator) and uses the Swish test certificate included in the package, not the files you uploaded. That test certificate belongs to the Swish test number 1234679304, so enter that number in Swish Number while you test, and your own number again before you turn test mode off. No real money is moved in the test environment.
Still need help?
Open a support ticket from your account and our team will look at your store with you.