Commits

Mikhail Korobov committed d1fe922

Logging for postback debug

Comments (0)

Files changed (3)

 """
 from hashlib import md5
 import urllib2
+import logging
 from urllib import urlencode
 
 POSTBACK_URL = 'https://www.payfast.co.za/eng/query/validate'
     False if data is invalid and None if the request failed.
     """
     post_str = urlencode(_values_to_encode(post_data))
+    logging.info(post_str)
     try:
         response = urllib2.urlopen(postback_url, post_str).read()
     except urllib2.HTTPError:
             raise forms.ValidationError('untrusted ip: %s' % self.ip)
 
         if conf.USE_POSTBACK:
-            if not data_is_valid(self.request.POST):
-                raise forms.ValidationError('Request validation fails')
+            is_valid = data_is_valid(self.request.POST)
+            if is_valid is None:
+                raise forms.ValidationError('Postback fails')
+            if not is_valid:
+                raise forms.ValidationError('Postback validation fails')
+
 
         return self.cleaned_data
 
 
 setup(
     name='django-payfast',
-    version='0.1.5',
+    version='0.1.6',
     author='Mikhail Korobov',
     author_email='kmike84@gmail.com',