Changeset 7130 for WAeUP_SRP/trunk/skins/waeup_epayment
- Timestamp:
- 17 Nov 2011, 16:37:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_cb.py
r6984 r7130 43 43 44 44 referer = request.get('HTTP_REFERER','none') 45 real_ip = request.get('HTTP_X_REAL_IP',"none") 45 real_ip = request.get('HTTP_X_REAL_IP',"none") 46 46 logger.info('%s, callback referer = %s, IP = %s' % (student_id,referer,real_ip)) 47 47 … … 86 86 wftool.doActionFor(context,'open') 87 87 pay_doc = context.getContent() 88 resp = pd['resp_code'] 89 90 if resp == '00':91 try:92 amount = int(getattr(pay_doc,'amount',0))93 try:94 surcharge = int(getattr(pay_doc,'surcharge',0))95 except:96 surcharge = 097 resp_approved_amount = int(pd['resp_approved_amount'])98 #set_trace()99 if not ontest and amount + surcharge != resp_approved_amount:100 logger.info('Warning: %s, approved amount %s and authorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id))101 pd['status'] = 'failed'102 pd['resp_desc'] = 'Warning: approved amount in callback does not match!'103 resp = ''104 else:105 pass106 except:107 logger.info('%s: approved amount could not be verified for payment %s of %s' % (member,context.getId(),student_id))108 pd['status'] = 'failed'109 pd['resp_desc'] = 'Warning: approved amount could not be verified!'110 resp = '' 88 resp = pd['resp_code'] 89 90 #if resp == '00': 91 # try: 92 # amount = int(getattr(pay_doc,'amount',0)) 93 # try: 94 # surcharge = int(getattr(pay_doc,'surcharge',0)) 95 # except: 96 # surcharge = 0 97 # resp_approved_amount = int(pd['resp_approved_amount']) 98 # #set_trace() 99 # if not ontest and amount + surcharge != resp_approved_amount: 100 # logger.info('Warning: %s, approved amount %s and authorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id)) 101 # pd['status'] = 'failed' 102 # pd['resp_desc'] = 'Warning: approved amount in callback does not match!' 103 # resp = '' 104 # else: 105 # pass 106 # except: 107 # logger.info('%s: approved amount could not be verified for payment %s of %s' % (member,context.getId(),student_id)) 108 # pd['status'] = 'failed' 109 # pd['resp_desc'] = 'Warning: approved amount could not be verified!' 110 # resp = '' 111 111 112 112 pay_doc.edit(mapping = pd) … … 122 122 next_previous_verdict = next_info['next_previous_verdict'] 123 123 if resp == '00': 124 if pay_doc.category == 'schoolfee': 124 if pay_doc.category == 'schoolfee': 125 125 if context.getStudentReviewState() == "school_fee_paid": 126 126 logger.info('%s paid school_fee in state school_fee_paid' % (student_id)) … … 144 144 145 145 elif pay_doc.category == 'hostel_maintenance': 146 146 147 147 ## callback function for accommodation_catalog method 148 148 data={} … … 152 152 data['acco_maint_pay_id'] = context.getId() 153 153 data['reservation_status'] = 'maintenance_fee_paid' 154 context.accommodation_catalog.modifyRecord(**data) 155 154 context.accommodation_catalog.modifyRecord(**data) 155 156 156 ## callback function for accommodation object method (deactivated since March 2011) 157 157 #acco_info = context.getAccommodationInfo() … … 168 168 #except: 169 169 # logger.info('%s no workflow action pay_maintenance_fee' % student_id) 170 170 171 171 elif pay_doc.category == 'acceptance': 172 172 if context.getStudentReviewState() in ('admitted', 'objection_raised'): … … 199 199 200 200 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url()) 201
Note: See TracChangeset for help on using the changeset viewer.