Swish

Overview


Swish is a mobile payment company created by Nordic banks. HostBill supports Swish payments out of the box.

Activating the module


In order to activate the module login to your HostBill admin panel, go to Settings → Modules → Payment Modules, choose Swish gateway and click Activate.

Module configuration


Once the payment gateway is activated you need to configure it. 
Please see external articles on how to setup:

Then proceed to fill in all other configuration fields:

  • Payee Alias - Swish number e.g. 1231181189. Required field

  • Path to certificate file - The path to the certificate in .pem format

  • Path to certificate key file - The path to the certificate key in .pem format

  • Path to root certificate file - The path to the root certificate in .pem format

  • Certificate password - Set only if a password is set for the certificate (for the .pem file)

  • Certificate key password - Set only if the password is set for the certificate key

  • Certificate Name - Required field if your server uses NSS instead of OpenSSL. Set this option only if your server uses NSS

  • Path to NSS database - Full path to the NSS database. Required field if your server uses NSS instead of OpenSSL. Set this option only if your server uses NSS

  • Test mode

NSS database configuration


If your server uses NSS, you will need to add the certificate to the NSS database. To do this, follow these steps:

  1. Create a PFX file using the certificate and certificate key

    openssl pkcs12 -export -out swish.pfx -inkey {$path_to_key} -in {$path_to_certificate}
  2. Create a directory for the NSS database (HostBill should have access to this directory)

    mkdir {$path}/nssdb
  3. The full directory path should be set in the Path to NSS database field (e.g. /home/hostbill/nssdb)

  4. Create a new NSS database

    certutil -N -d {$path}/nssdb --empty-password
  5. Import the certificate into the database

    pk12util -i swish.pfx -d sql:{$path}/nssdb/ -W "" -K ""
  6. Check the certificate name using the command:

    certutil -d sql:{$path}/nssdb/ -L
  7. Set the certificate name in the Certificate Name field (e.g. 1234679304 - Swedbank AB (publ))


Make sure that the directory with the NSS database and all files in this directory belong to the user who is using HostBill.

If you have problems creating the database, repeat the steps as the root user, and then change the owner and group for the directory and all files in it.


Generating PEM from PFX


To generate PEM files from PFX use the following commands (assuming the PFX file is named swish.pfx):

Generating cert.pem
openssl pkcs12 -in swish.pfx -clcerts -out cert.pem
Generating root.pem
openssl pkcs12 -in swish.pfx -cacerts -out root.pem
Generating key.pem
openssl pkcs12 -in swish.pfx -nocerts -out key.pem


FAQ


Question: I've enabled the module but it does not display in my client portal.
Answer: This module does not support the currency you attempt to display it in, please use background currency conversion.