Browse files

Handle saving of query the way PayPal needs

  • Loading branch information...
1 parent 2c84047 commit d09a50be7b8a493e8b59865a040e6065191e936b @spookylukey committed Jun 12, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 paypal/standard/models.py
View
7 paypal/standard/models.py
@@ -306,7 +306,12 @@ def send_signals(self):
def initialize(self, request):
"""Store the data we'll need to make the postback from the request object."""
- self.query = getattr(request, request.method).urlencode()
+ if request.method == 'GET':
+ # PDT only - this data is currently unused
+ self.query = request.META.get('QUERY_STRING', '')
+ elif request.method == 'POST':
+ # The following works if paypal sends an ASCII bytestring, which it does.
+ self.query = request.raw_post_data
self.ipaddress = request.META.get('REMOTE_ADDR', '')
def _postback(self):

0 comments on commit d09a50b

Please sign in to comment.