There are four different types of codes. They all start with a letter to signify what type of code it is.
Pay to a swish number.
A
<swish number>
A0708123456
Pay a specified amount to a swish number.
B
<swish number>
;
<amount>
B0708123456;100
Pay a specified amount to a swish number, with a custom message and specify what fields are editable.
C
<swish number>
;
<amount>
;
<message>
;
<editable fields>
<message>
and <editable fields>
can be of length 0
, but the semicolons inbetween are required.
This can be used to prefill a value in the fields but keep the fields editable by the user.
Swish expects an integer value (in base 10), and the editable fields are represented by a bitstring.
PHONE_EDITABLE = 0b001
AMOUNT_EDITABLE = 0b010
MESSAGE_EDITABLE = 0b100
To make both the phone number and amount field editable just bitwise OR the two values.
PHONE_EDITABLE | AMOUNT_EDITABLE // = 0b011
// converted to base 10 = 3
Functionally same as the B
example:
C0708123456;100;;
Message
will be put in the message field:
C0708123456;100;Message;
Message
will be put in the message field:
C0708123456;100;Message;
Message
will be put in the message field, phone number and amount is editable (but message is not):
C0708123456;100;Message;3
To be documented… Seems to be a base64
-string.