Changeset 16555 for main/kofacustom.nigeria/trunk
- Timestamp:
- 18 Jul 2021, 21:14:29 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/paydirectbrowser.py
r16528 r16555 113 113 self.ref_number = self.merchant_id + self.context.p_id[1:] 114 114 # Create a PAYDirect Booking 115 if not self.context.r_company: 116 result_xml = create_paydirect_booking( 117 self.merchant_id, self.context, self.gateway_host, 118 self.gateway_url, True) 119 if result_xml.startswith('Connection error'): 120 IPayer(self.context).payer.writeLogMessage(self, result_xml) 121 return result_xml 122 doc=parseString(result_xml) 123 if not doc.getElementsByTagName('ResponseCode'): 124 IPayer(self.context).payer.writeLogMessage(self, 'invalid callback') 125 return _('Invalid callback from Interswitch') 126 rc = doc.getElementsByTagName('ResponseCode')[0].firstChild.data 127 IPayer(self.context).payer.writeLogMessage(self, 'response code: %s' % rc) 128 if rc not in ('100', '108'): 129 return 'Error response code from Interswitch: %s' % rc 115 result_xml = create_paydirect_booking( 116 self.merchant_id, self.context, self.gateway_host, 117 self.gateway_url, True) 118 if result_xml.startswith('Connection error'): 119 IPayer(self.context).payer.writeLogMessage(self, result_xml) 120 return result_xml 121 doc=parseString(result_xml) 122 if not doc.getElementsByTagName('ResponseCode'): 123 IPayer(self.context).payer.writeLogMessage(self, 'invalid callback') 124 return _('Invalid callback from Interswitch') 125 rc = doc.getElementsByTagName('ResponseCode')[0].firstChild.data 126 IPayer(self.context).payer.writeLogMessage(self, 'response code: %s' % rc) 127 if rc not in ('100', '108'): 128 return 'Error response code from Interswitch: %s' % rc 130 129 return 131 130 … … 134 133 self.context.student.current_session, self.context): 135 134 self.flash(_('Forbidden'), type='danger') 136 self.redirect(self.url(self.context, '@@index'))137 return138 error = self.init_update()139 if error:140 self.flash(error, type='danger')141 135 self.redirect(self.url(self.context, '@@index')) 142 136 return … … 148 142 self.context.gateway_amt = self.gateway_amt 149 143 self.context.r_company = u'interswitch' 144 error = self.init_update() 145 if error: 146 self.flash(error, type='danger') 147 self.redirect(self.url(self.context, '@@index')) 148 return 150 149 return 151 150 … … 179 178 self.redirect(self.url(self.context, '@@index')) 180 179 return 181 error = self.init_update()182 if error:183 self.flash(error, type='danger')184 self.redirect(self.url(self.context, '@@index'))185 if self.context.__parent__.__parent__.expired \186 and self.context.__parent__.__parent__.strict_deadline:187 return _("Payment ticket can't be used. "188 "Application period has expired.")189 180 # Already now it becomes an Interswitch payment. We set the net amount 190 181 # and add the gateway amount. … … 194 185 self.context.gateway_amt = self.gateway_amt 195 186 self.context.r_company = u'interswitch' 187 error = self.init_update() 188 if error: 189 self.flash(error, type='danger') 190 self.redirect(self.url(self.context, '@@index')) 191 if self.context.__parent__.__parent__.expired \ 192 and self.context.__parent__.__parent__.strict_deadline: 193 return _("Payment ticket can't be used. " 194 "Application period has expired.") 196 195 return 197 196
Note: See TracChangeset for help on using the changeset viewer.