Index: WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTool.py	(revision 1664)
+++ WAeUP_SRP/trunk/WAeUPTool.py	(revision 1665)
@@ -531,4 +531,51 @@
     ###)
 
+    security.declareProtected(ModifyPortalContent,"getInvalidCallbackTransactions")###(
+    def getCallbacksFromLog(self,filename):
+        """fix Online Payment Transactions from Z2.log entries"""
+        import transaction
+        import random
+        from cgi import parse_qs
+        from urlparse import urlparse
+        #from pdb import set_trace
+        wftool = self.portal_workflow
+        current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
+        students_folder = self.portal_url.getPortalObject().campus.students
+        s = r'(?P<client_ip>\S+) - (?P<member_id>\S+) \['
+        s += r'(?P<date>.*)\] "(?P<get>.*)" (?P<codes>\d+ \d+) "'
+        s += r'(?P<intersw>.*)" "(?P<agent>.*)"'
+        data = re.compile(s)
+        start = True
+        tr_count = 1
+        total = 0
+        #name = 'pume_results'
+        #name = 'epaymentsuccessful_z2log2'
+        name = filename
+        no_import = []
+        imported = []
+        logger = logging.getLogger('WAeUPTool.getFailedTransactions')
+        try:
+            transactions = open("%s/import/%s" % (i_home,name),"rb").readlines()
+        except:
+            logger.error('Error reading %s' % name)
+            return
+        tas = []
+        for line in transactions:
+            dict = {}
+            items = data.search(line)
+            dict['idict'] = idict = items.groupdict()
+            #print idict
+            #from pdb import set_trace;set_trace()
+            urlparsed = urlparse(idict['get'][4:])
+            #print urlparsed
+            path = urlparsed[2].split('/')
+            dict['student_id'] = student_id = path[8]
+            dict['payment_id'] = payment_id = path[10]
+            dict['qs_dict'] = qs_dict = parse_qs(urlparsed[4])
+            tas.append(dict)
+            tr_count += 1
+        return tas
+    ###)
+
     security.declareProtected(ModifyPortalContent,"importOnlinePaymentTransactions")###(
     def importOnlinePaymentTransactions(self):
