[Answered ]-Paypal IPN verification in Django

2๐Ÿ‘

โœ…

If your parameters object is a Django QueryDict, it already has a very convenient urlencode() method on it. Try something like this instead:

parameters = request.POST.copy()
parameters['cmd']='_notify-validate'
return self.call_paypal(parameters.urlencode()) == 'VERIFIED'

The copy() call is needed because the QueryDict from the request object is read-only. Calling copy() makes a mutable deep-copy that you are free to modify.

I do something like this in my Paypal IPN application and it has been working for some time.

๐Ÿ‘คBrian Neal

0๐Ÿ‘

As your self.params contains some non ASCII characters so you have to encode this to UTF-8 before passing to urllib.urlencode, Look at this answer, it explains how to pass the parameters to urlencode.

๐Ÿ‘คAhsan

Leave a comment