-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump_ipn.py
More file actions
36 lines (27 loc) · 762 Bytes
/
dump_ipn.py
File metadata and controls
36 lines (27 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import logging
import time
import csv
import os
import webapp2
import StringIO
import PaypalIPN
from google.appengine.ext import db
from google.appengine.ext.webapp.util import run_wsgi_app
class Error(Exception):
pass
class DumpIPNs(webapp2.RequestHandler):
def get(self):
return self.post()
def post(self):
self.response.headers['Content-Type'] = 'text/plain'
key = self.request.get('key')
ipn = db.get(key)
if not ipn:
self.response.out.write('No such IPN: %s', key)
return
d = ipn.Templatify()
self.response.out.write('IPN %s (%s)\n' % (key, d.get('txn_id')))
for k, v in d.iteritems():
self.response.out.write('%s = %s\n' % (k, v))
app = webapp2.WSGIApplication(
[('/dump-ipn', DumpIPNs)])