dcramer/django-paypal — pull request #22 by spookylukey (2012-06-12 00:30:23+00:00)
Title: Fix encoding

Fixes two problems with non ASCII characters.

Both of them were caused by the fact that request.POST was not taking into account the declared charset in the data posted by PayPal. The two problems are:

1) the IPN object was being populated incorrectly, with things like "J�rg" instead of "Jörg". The fix for this has full tests - which mainly involved changing the IPN tests to match the way that Paypal does it.

2) the use of request.POST.urlencode() caused the wrong data to be stored in PayPalIPN.query, resulting in the IPN being marked as invalid when checked against PayPal. This can be avoided using request.raw_post_data. There isn't specific test for this, because it depends largely on the behaviour of PayPal.