jazzband / django-payments

Universal payment handling for Django.
https://django-payments.readthedocs.io
Other
1.01k stars 278 forks source link

Sofort description length need to count bytes #308

Open Natureshadow opened 2 years ago

Natureshadow commented 2 years ago

I hate it when I am right and know in advance what bugs others will implement…

As predicted in #296, today we sent a 40-character description to Klarna containing a unicode ö, and they did what I said – they complained that it is 41 characters long ;).

Fix will come some time today.

WhyNotHugo commented 2 years ago

It seems they need it to be 40 bytes long, not 40 characters long.

In [1]: len("Ö".encode())
Out[1]: 2
Natureshadow commented 2 years ago

It seems they need it to be 40 bytes long, not 40 characters long.

Yep, exactly as I said ;).

WhyNotHugo commented 2 years ago

This should be useful: https://stackoverflow.com/a/43848928