Index: WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py	(revision 1623)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py	(revision 1624)
@@ -62,5 +62,5 @@
         if t_order_id == order_id:
             rwrite('"%s","%s","%s","%s","%s"' % (student_id,
-                                                                        payment_id,
+                                                                        op_brain.getId,
                                                                         transaction.response_code,
                                                                         payment_doc.resp_code,
Index: WAeUP_SRP/trunk/skins/waeup_epayment/check_transactions.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/check_transactions.py	(revision 1623)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/check_transactions.py	(revision 1624)
@@ -33,4 +33,5 @@
 correct = 0
 count = 0
+approved = 0
 for ot_brain in online_transactions():
     student_id = ot_brain.student_id
@@ -47,22 +48,45 @@
         rwrite("%s payment %s not found" % (student_id,payment_id))
         continue
-    payment_doc = getattr(payments_folder,payment_id).getContent()
+    payment_obj = getattr(payments_folder,payment_id)
+    payment_doc = payment_obj.getContent()
     response_code = ot_brain.response_code
     count +=1
     if payment_doc.resp_code != response_code:
         rwrite('"%d","%d","%s","%s","%s","%s"' % (
-                                                                        count,correct,
-                                                                        student_id,
-                                                                        payment_id,
-                                                                        response_code,
-                                                                        payment_doc.resp_code
-                                                                        ))
+                                                  count,correct,
+                                                  student_id,
+                                                  payment_id,
+                                                  response_code,
+                                                  payment_doc.resp_code
+                                                  ))
     elif payment_doc.resp_code == response_code:
         correct +=1
         rwrite('"%d","%d","%s","%s","%s","%s"' % (
-                                                                        count,correct,
-                                                                        student_id,
-                                                                        payment_id,
-                                                                        response_code,
-                                                                        payment_doc.resp_code
-                                                                        ))
+                                                  count,correct,
+                                                  student_id,
+                                                  payment_id,
+                                                  response_code,
+                                                  payment_doc.resp_code
+                                                  ))
+    if payment_doc.resp_code == "" and response_code == "00":
+        pd = {}
+        review_state = wftool.getInfoFor(payment_obj,'review_state',None)
+        if review_state != "opened":
+            logger.info('payment object of %s closed' % (student_id))
+            continue
+        review_state = wftool.getInfoFor(student_obj,'review_state',None)
+        if review_state != "cleared_and_validated":
+            logger.info('%s review_state = %s' % (student_id,review_state))
+            continue
+        pd['resp_code'] = 'IP'
+        pd['resp_desc'] = 'Payment approved by import, %s' % (DateTime.DateTime())
+        payment_doc.edit(mapping=pd)
+        if payment_doc.type_description.startswith('School Fee'):
+            wftool.doActionFor(student_obj,'pay_school_fee')
+        logger.info('%s approves epayment for %s by import' % (member,student_id))
+        wftool.doActionFor(payment_obj,'close')
+        approved += 1
+        if approved > 50:
+            context.waeup_tool.doCommit()
+            logger.info('%s transactions commited' % (approved))
+            approved = 0
