Whitespace
Whitespace;
Do not use %d format for trustly id's and do not typecast to int.

Use a trustlyID() function for checking contents of the id before using
it. Always use "%s" (with quotes) for the format.
Uniform quoting for SQL, use sprintf() rather then inline values.
Change mapping for Swedish, se seems to be used rather then sv.
Handle decimals properly when refunding.

Do not assume input is an Int. Do format it with 2 decimals before
communicating with Trustly.
Add locks to prevent concurrent notification processing.

Add a locking mechanism to the trustly_orders table. Lock the order
using this table while processing the notifications. This to prevent
processing of more then one notification for the same order at the same
time. The processing is full of race conditions.
Get the canceled message from the language, not config