Troubleshooting
The most frequent problems with Swish för handel, what causes them and how to fix them.
Swish does not appear in the checkout
Check these points in order:
- Status is on and you pressed Save.
- The checkout currency is Swedish krona (SEK). Swish is hidden for every other currency.
- The order total reaches the value in Total, if you set one.
- The customer's address is inside one of the zones selected in Geo Zone, if you selected any.
An alert says the variable SwishTimeout is not defined
The message Global variable SwishTimeout not defined, make sure that you refreshed OCMOD changes and cleared all possible cache appears at checkout when the small script that the extension adds to your theme header is missing.
- Open Extensions > Modifications and press Refresh. On OpenCart 1.5, check that
devmanextensions_swish_for_handel.xmlis in/vqmod/xml/. - On OpenCart 3.x, clear the theme cache from the gear button on the administration dashboard.
- If your theme has its own header file outside the usual
common/headertemplate, or a cache module, clear that cache too.
If the alert remains, open a support ticket.
A Swish error code appears at checkout
Errors from Swish are shown to the customer as Error code followed by the Swish code and its message. The usual ones:
| Code | Meaning | What to do |
|---|---|---|
RP03 | Callback URL is missing or does not use HTTPS | Install a valid HTTPS certificate on the store and make sure OpenCart uses https:// addresses. |
RP01 | Payee alias is missing or empty | Enter your Swish Number and save. |
ACMT07 | Payee not enrolled | The Swish Number is not an active Swish för handel number. Check it with your bank. In test mode, use 1234679304. |
BE18 | Payer alias is invalid | The customer's phone number is not valid for Swish. |
ACMT03 | Payer not enrolled | The customer's number is not connected to Swish. |
AM03 | Invalid or missing currency | The order is not in SEK. |
RP06 | Another active payment request already exists for this payer | The customer has an unfinished Swish payment. Wait a few minutes and try again. |
TM01 | Swish timed out before the payment was started | The customer did not open the payment in time. Try again. |
The connection to Swish fails
A message starting with cURL error number means that your server could not complete the secure connection to Swish. Check that:
- both Certificate file .crt and Key file .key show that the file exists;
- the certificate and the key belong together, the certificate was saved in PEM format and the key has no password;
- the certificate has not expired in the Swish certificate portal;
- your hosting allows outgoing HTTPS connections and the PHP cURL extension is enabled.
The message cURL PHP library is not installed in your server! means that the PHP cURL extension is missing. Ask your hosting provider to enable it.
The upload of the certificate fails
- Error: Upload .crt file. or Error: Upload .key file. means that the file name does not end in
.crtor.key. Rename the file on your computer and upload it again. - Error uploading your file to … means that the folder
system/library/swish_certificates/cannot be written. Ask your hosting provider to give PHP write permission on that folder.
The customer paid but the order was not updated
The order is confirmed when Swish sends its payment notification to your store. If the notification cannot reach the store, the customer may see the success page while the order keeps no status.
- Make sure the store is reachable from the internet over HTTPS and that no firewall, maintenance mode or password protection blocks requests from Swish.
- If the store is behind Cloudflare, turn on Cloudflare in the settings.
- Check that Order status completed is set.
The Swish Refund button is missing
- The order must have been paid with Swish.
- Its status must be the Order status completed, the ERROR order status, or one of the Extra refundable Orders.
- Status must be on.
- Refresh the modifications after installing or updating, since the button is added through them.
A refund shows an error
- Payment reference not found: the Swish payment reference of this order was not saved, so it cannot be refunded from OpenCart. Use the tools of your bank or Swish.
- Order #… was placed in …: the order is not in Swedish krona (SEK), and Swish refunds can only be made in SEK. Refund that order through your bank.
- An Error code from Swish: the refund was refused by Swish. The message gives the code and the reason.
When a refund fails after it started, the order moves to the ERROR order status. The notifications of refunds are written to the OpenCart log file swish.log, in the logs folder of your store. Include it when you open a support ticket.
Still need help?
Open a support ticket from your account and our team will look at your store with you.