Changeset 1624
- Timestamp:
- 22 Mar 2007, 23:30:32 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_epayment
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_epayment/check_online_payments.py
r1623 r1624 62 62 if t_order_id == order_id: 63 63 rwrite('"%s","%s","%s","%s","%s"' % (student_id, 64 payment_id,64 op_brain.getId, 65 65 transaction.response_code, 66 66 payment_doc.resp_code, -
WAeUP_SRP/trunk/skins/waeup_epayment/check_transactions.py
r1622 r1624 33 33 correct = 0 34 34 count = 0 35 approved = 0 35 36 for ot_brain in online_transactions(): 36 37 student_id = ot_brain.student_id … … 47 48 rwrite("%s payment %s not found" % (student_id,payment_id)) 48 49 continue 49 payment_doc = getattr(payments_folder,payment_id).getContent() 50 payment_obj = getattr(payments_folder,payment_id) 51 payment_doc = payment_obj.getContent() 50 52 response_code = ot_brain.response_code 51 53 count +=1 52 54 if payment_doc.resp_code != response_code: 53 55 rwrite('"%d","%d","%s","%s","%s","%s"' % ( 54 55 56 57 58 59 56 count,correct, 57 student_id, 58 payment_id, 59 response_code, 60 payment_doc.resp_code 61 )) 60 62 elif payment_doc.resp_code == response_code: 61 63 correct +=1 62 64 rwrite('"%d","%d","%s","%s","%s","%s"' % ( 63 count,correct, 64 student_id, 65 payment_id, 66 response_code, 67 payment_doc.resp_code 68 )) 65 count,correct, 66 student_id, 67 payment_id, 68 response_code, 69 payment_doc.resp_code 70 )) 71 if payment_doc.resp_code == "" and response_code == "00": 72 pd = {} 73 review_state = wftool.getInfoFor(payment_obj,'review_state',None) 74 if review_state != "opened": 75 logger.info('payment object of %s closed' % (student_id)) 76 continue 77 review_state = wftool.getInfoFor(student_obj,'review_state',None) 78 if review_state != "cleared_and_validated": 79 logger.info('%s review_state = %s' % (student_id,review_state)) 80 continue 81 pd['resp_code'] = 'IP' 82 pd['resp_desc'] = 'Payment approved by import, %s' % (DateTime.DateTime()) 83 payment_doc.edit(mapping=pd) 84 if payment_doc.type_description.startswith('School Fee'): 85 wftool.doActionFor(student_obj,'pay_school_fee') 86 logger.info('%s approves epayment for %s by import' % (member,student_id)) 87 wftool.doActionFor(payment_obj,'close') 88 approved += 1 89 if approved > 50: 90 context.waeup_tool.doCommit() 91 logger.info('%s transactions commited' % (approved)) 92 approved = 0
Note: See TracChangeset for help on using the changeset viewer.