[7894] | 1 | ## $Id: browser.py 9442 2012-10-27 06:37:54Z henrik $ |
---|
| 2 | ## |
---|
| 3 | ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
| 18 | from datetime import datetime |
---|
[7898] | 19 | import httplib |
---|
| 20 | import urllib |
---|
[9392] | 21 | import hashlib |
---|
[7898] | 22 | from xml.dom.minidom import parseString |
---|
[7894] | 23 | import grok |
---|
[8281] | 24 | from zope.component import getUtility |
---|
[7894] | 25 | from waeup.kofa.browser.layout import KofaPage, UtilityView |
---|
| 26 | from waeup.kofa.accesscodes import create_accesscode |
---|
[8281] | 27 | from waeup.kofa.interfaces import RETURNING, IKofaUtils |
---|
| 28 | from waeup.kofa.utils.helpers import to_timezone |
---|
[8421] | 29 | from waeup.kofa.students.viewlets import ApprovePaymentActionButton as APABStudent |
---|
| 30 | from waeup.kofa.applicants.viewlets import ApprovePaymentActionButton as APABApplicant |
---|
[9347] | 31 | from waeup.kwarapoly.students.interfaces import ICustomStudentOnlinePayment |
---|
| 32 | from waeup.kwarapoly.applicants.interfaces import ICustomApplicantOnlinePayment |
---|
| 33 | from waeup.kwarapoly.interfaces import MessageFactory as _ |
---|
[7894] | 34 | |
---|
[9387] | 35 | PRODUCT_ID = '3986' |
---|
[9347] | 36 | SITE_NAME = 'kwarapoly-kofa.waeup.org' |
---|
[9387] | 37 | PROVIDER_ACCT = '1010764827' |
---|
| 38 | PROVIDER_BANK_ID = '117' |
---|
[8263] | 39 | PROVIDER_ITEM_NAME = 'BT Education' |
---|
[9347] | 40 | INSTITUTION_NAME = 'KwaraPoly' |
---|
[7894] | 41 | CURRENCY = '566' |
---|
[8401] | 42 | #QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx' |
---|
[8293] | 43 | #QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx' |
---|
[9392] | 44 | |
---|
[9387] | 45 | #POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx' |
---|
| 46 | POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx' |
---|
[7894] | 47 | |
---|
[9387] | 48 | #HOST = 'webpay.interswitchng.com' |
---|
| 49 | HOST = 'testwebpay.interswitchng.com' |
---|
[9392] | 50 | |
---|
[9387] | 51 | #URL = '/paydirect/services/TransactionQueryWs.asmx' |
---|
| 52 | URL = '/test_paydirect/services/TransactionQueryWs.asmx' |
---|
[7898] | 53 | httplib.HTTPConnection.debuglevel = 0 |
---|
| 54 | |
---|
[8256] | 55 | |
---|
[7898] | 56 | def SOAP_post(soap_action,xml): |
---|
| 57 | """Handles making the SOAP request. |
---|
| 58 | |
---|
| 59 | Further reading: |
---|
| 60 | http://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryWs.asmx?op=getTransactionData |
---|
| 61 | """ |
---|
| 62 | h = httplib.HTTPConnection(HOST) |
---|
| 63 | headers={ |
---|
| 64 | 'Host':HOST, |
---|
| 65 | 'Content-Type':'text/xml; charset=utf-8', |
---|
| 66 | 'Content-Length':len(xml), |
---|
| 67 | 'SOAPAction':'"%s"' % soap_action, |
---|
| 68 | } |
---|
| 69 | h.request('POST', URL, body=xml,headers=headers) |
---|
| 70 | r = h.getresponse() |
---|
| 71 | d = r.read() |
---|
| 72 | if r.status!=200: |
---|
| 73 | raise ValueError('Error connecting: %s, %s' % (r.status, r.reason)) |
---|
| 74 | return d |
---|
| 75 | |
---|
| 76 | def get_SOAP_response(product_id, transref): |
---|
| 77 | xml="""\ |
---|
| 78 | <?xml version="1.0" encoding="utf-8"?> |
---|
| 79 | <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
---|
| 80 | <soap:Body> |
---|
| 81 | <getTransactionData xmlns="http://tempuri.org/"> |
---|
| 82 | <product_id>%s</product_id> |
---|
| 83 | <trans_ref>%s</trans_ref> |
---|
| 84 | </getTransactionData> |
---|
| 85 | </soap:Body> |
---|
| 86 | </soap:Envelope>""" % (product_id, transref) |
---|
| 87 | result_xml=SOAP_post("http://tempuri.org/getTransactionData",xml) |
---|
| 88 | doc=parseString(result_xml) |
---|
| 89 | response=doc.getElementsByTagName('getTransactionDataResult')[0].firstChild.data |
---|
| 90 | return response |
---|
| 91 | |
---|
[8430] | 92 | def query_interswitch(payment): |
---|
[8256] | 93 | sr = get_SOAP_response(PRODUCT_ID, payment.p_id) |
---|
| 94 | wlist = sr.split(':') |
---|
| 95 | if len(wlist) != 7: |
---|
[8430] | 96 | msg = _('Invalid callback: ${a}', mapping = {'a': sr}) |
---|
| 97 | log = 'invalid callback for payment %s: %s' % (payment.p_id, sr) |
---|
| 98 | return False, msg, log |
---|
[8256] | 99 | payment.r_code = wlist[0] |
---|
| 100 | payment.r_desc = wlist[1] |
---|
| 101 | payment.r_amount_approved = float(wlist[2]) / 100 |
---|
| 102 | payment.r_card_num = wlist[3] |
---|
| 103 | payment.r_pay_reference = wlist[5] |
---|
[9442] | 104 | payment.r_company = u'interswitch' |
---|
[8256] | 105 | if payment.r_code != '00': |
---|
[8430] | 106 | msg = _('Unsuccessful callback: ${a}', mapping = {'a': sr}) |
---|
[9442] | 107 | log = 'unsuccessful callback for %s payment %s: %s' % ( |
---|
| 108 | payment.p_category, payment.p_id, sr) |
---|
[8256] | 109 | payment.p_state = 'failed' |
---|
[8430] | 110 | return False, msg, log |
---|
[8263] | 111 | if payment.r_amount_approved != payment.amount_auth: |
---|
[8430] | 112 | msg = _('Callback amount does not match.') |
---|
[9442] | 113 | log = 'wrong callback for %s payment %s: %s' % ( |
---|
| 114 | payment.p_category, payment.p_id, sr) |
---|
[8256] | 115 | payment.p_state = 'failed' |
---|
[8430] | 116 | return False, msg, log |
---|
[8256] | 117 | if wlist[4] != payment.p_id: |
---|
[8430] | 118 | msg = _('Callback transaction id does not match.') |
---|
[9442] | 119 | log = 'wrong callback for %s payment %s: %s' % ( |
---|
| 120 | payment.p_category, payment.p_id, sr) |
---|
[8256] | 121 | payment.p_state = 'failed' |
---|
[8430] | 122 | return False, msg, log |
---|
[8256] | 123 | payment.p_state = 'paid' |
---|
[8433] | 124 | payment.payment_date = datetime.utcnow() |
---|
[8430] | 125 | msg = _('Successful callback received') |
---|
[9436] | 126 | log = 'valid callback for %s payment %s: %s' % ( |
---|
| 127 | payment.p_category, payment.p_id, sr) |
---|
[8430] | 128 | return True, msg, log |
---|
[8256] | 129 | |
---|
[8421] | 130 | class InterswitchActionButtonStudent(APABStudent): |
---|
[8259] | 131 | grok.order(1) |
---|
[8255] | 132 | grok.context(ICustomStudentOnlinePayment) |
---|
[8430] | 133 | grok.require('waeup.payStudent') |
---|
[7894] | 134 | icon = 'actionicon_pay.png' |
---|
| 135 | text = _('CollegePAY') |
---|
| 136 | target = 'goto_interswitch' |
---|
| 137 | |
---|
| 138 | @property |
---|
| 139 | def target_url(self): |
---|
| 140 | if self.context.p_state != 'unpaid': |
---|
| 141 | return '' |
---|
| 142 | return self.view.url(self.view.context, self.target) |
---|
| 143 | |
---|
[8421] | 144 | class InterswitchActionButtonApplicant(APABApplicant): |
---|
[8259] | 145 | grok.order(1) |
---|
[8256] | 146 | grok.context(ICustomApplicantOnlinePayment) |
---|
[8430] | 147 | grok.require('waeup.payApplicant') |
---|
[8256] | 148 | icon = 'actionicon_pay.png' |
---|
| 149 | text = _('CollegePAY') |
---|
| 150 | target = 'goto_interswitch' |
---|
| 151 | |
---|
| 152 | @property |
---|
| 153 | def target_url(self): |
---|
| 154 | if self.context.p_state != 'unpaid': |
---|
| 155 | return '' |
---|
| 156 | return self.view.url(self.view.context, self.target) |
---|
| 157 | |
---|
[8421] | 158 | class InterswitchRequestWebserviceActionButtonStudent(APABStudent): |
---|
[8259] | 159 | grok.order(2) |
---|
[8255] | 160 | grok.context(ICustomStudentOnlinePayment) |
---|
[8430] | 161 | grok.require('waeup.payStudent') |
---|
[7919] | 162 | icon = 'actionicon_call.png' |
---|
[8421] | 163 | text = _('Requery CollegePAY') |
---|
[7919] | 164 | target = 'request_webservice' |
---|
| 165 | |
---|
[8421] | 166 | class InterswitchRequestWebserviceActionButtonApplicant(APABApplicant): |
---|
[8259] | 167 | grok.order(2) |
---|
[8256] | 168 | grok.context(ICustomApplicantOnlinePayment) |
---|
[8430] | 169 | grok.require('waeup.payApplicant') |
---|
[8256] | 170 | icon = 'actionicon_call.png' |
---|
[8421] | 171 | text = _('Requery CollegePAY') |
---|
[8256] | 172 | target = 'request_webservice' |
---|
[7919] | 173 | |
---|
[8256] | 174 | class InterswitchPageStudent(KofaPage): |
---|
[7894] | 175 | """ View which sends a POST request to the Interswitch |
---|
| 176 | CollegePAY payment gateway. |
---|
| 177 | """ |
---|
[8255] | 178 | grok.context(ICustomStudentOnlinePayment) |
---|
[7894] | 179 | grok.name('goto_interswitch') |
---|
[8256] | 180 | grok.template('student_goto_interswitch') |
---|
[7894] | 181 | grok.require('waeup.payStudent') |
---|
| 182 | label = _('Submit data to CollegePAY (Interswitch Payment Gateway)') |
---|
| 183 | submit_button = _('Submit') |
---|
| 184 | action = POST_ACTION |
---|
| 185 | site_name = SITE_NAME |
---|
| 186 | currency = CURRENCY |
---|
[9387] | 187 | pay_item_id = '101' |
---|
[7894] | 188 | product_id = PRODUCT_ID |
---|
[9392] | 189 | mac = '737396C271FB8E2BA1A612A942267553E16373658A5F83D90DAFFBB806C16E9E6284006C06CEFFB55768004179D7BC01CD237CCE6314B938A5A5D9F49369DE5A' |
---|
[7894] | 190 | |
---|
| 191 | def update(self): |
---|
[8256] | 192 | #if self.context.p_state != 'unpaid': |
---|
| 193 | if self.context.p_state == 'paid': |
---|
[7894] | 194 | self.flash(_("Payment ticket can't be re-send to CollegePAY.")) |
---|
| 195 | self.redirect(self.url(self.context, '@@index')) |
---|
| 196 | return |
---|
[8256] | 197 | |
---|
[8745] | 198 | student = self.student = self.context.student |
---|
| 199 | certificate = getattr(student['studycourse'],'certificate',None) |
---|
[8276] | 200 | self.amount_auth = 100 * self.context.amount_auth |
---|
[7894] | 201 | xmldict = {} |
---|
| 202 | if certificate is not None: |
---|
| 203 | xmldict['department'] = certificate.__parent__.__parent__.code |
---|
| 204 | xmldict['faculty'] = certificate.__parent__.__parent__.__parent__.code |
---|
| 205 | else: |
---|
| 206 | xmldict['department'] = None |
---|
| 207 | xmldict['faculty'] = None |
---|
[9408] | 208 | self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category] |
---|
[8281] | 209 | tz = getUtility(IKofaUtils).tzinfo |
---|
| 210 | self.local_date_time = to_timezone( |
---|
| 211 | self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z") |
---|
[8256] | 212 | self.site_redirect_url = self.url(self.context, 'request_webservice') |
---|
[8263] | 213 | # Provider data |
---|
| 214 | xmldict['detail_ref'] = self.context.p_id |
---|
| 215 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
| 216 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
| 217 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
[9387] | 218 | xmldict['provider_amt'] = 100 * 1200 |
---|
| 219 | # Dalash data |
---|
| 220 | xmldict['dalash_amt'] = 100 * 1800 |
---|
[8263] | 221 | # Institution data |
---|
[9387] | 222 | if xmldict['faculty'] in ('CPGS',): |
---|
| 223 | xmldict['institution_acct'] = "1771180233" |
---|
| 224 | xmldict['institution_bank_id'] = '120' |
---|
| 225 | elif xmldict['faculty'] in ('IBAS',): |
---|
| 226 | xmldict['institution_acct'] = "0006772436" |
---|
| 227 | xmldict['institution_bank_id'] = '121' |
---|
| 228 | elif xmldict['faculty'] in ('IETS',): |
---|
| 229 | xmldict['institution_acct'] = "0106259811" |
---|
| 230 | xmldict['institution_bank_id'] = '10' |
---|
| 231 | elif xmldict['faculty'] in ('IFMS',): |
---|
| 232 | xmldict['institution_acct'] = "2013910271" |
---|
| 233 | xmldict['institution_bank_id'] = '8' |
---|
| 234 | elif xmldict['faculty'] in ('ITCH',): |
---|
| 235 | xmldict['institution_acct'] = "1010445144" |
---|
[9129] | 236 | xmldict['institution_bank_id'] = '117' |
---|
| 237 | else: |
---|
[9387] | 238 | xmldict['institution_acct'] = "0000000000000" |
---|
[9129] | 239 | xmldict['institution_bank_id'] = '0' |
---|
| 240 | xmldict['institution_amt'] = 100 * ( |
---|
[9387] | 241 | self.context.amount_auth - 1200 - 300 - 1800) |
---|
[8263] | 242 | xmldict['institution_item_name'] = self.context.p_category |
---|
| 243 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
[9392] | 244 | |
---|
| 245 | hashargs = ( |
---|
| 246 | self.context.p_id + |
---|
| 247 | PRODUCT_ID + |
---|
| 248 | self.pay_item_id + |
---|
| 249 | str(int(self.amount_auth)) + |
---|
| 250 | self.site_redirect_url + |
---|
| 251 | self.mac) |
---|
| 252 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
| 253 | |
---|
[8263] | 254 | # Interswitch amount is not part of the xml data |
---|
| 255 | xmltext = """<payment_item_detail> |
---|
| 256 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 257 | <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
[9387] | 258 | <item_detail item_id="2" item_name="Dalash" item_amt="%(dalash_amt)s" bank_id="117" acct_num="1013196791" /> |
---|
[9129] | 259 | <item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
[8263] | 260 | </item_details> |
---|
| 261 | </payment_item_detail>""" % xmldict |
---|
| 262 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
[7894] | 263 | return |
---|
| 264 | |
---|
[8263] | 265 | class InterswitchPageApplicant(KofaPage): |
---|
[8256] | 266 | """ View which sends a POST request to the Interswitch |
---|
| 267 | CollegePAY payment gateway. |
---|
| 268 | """ |
---|
| 269 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 270 | grok.require('waeup.payApplicant') |
---|
| 271 | grok.template('applicant_goto_interswitch') |
---|
[8263] | 272 | grok.name('goto_interswitch') |
---|
| 273 | label = _('Submit data to CollegePAY (Interswitch Payment Gateway)') |
---|
| 274 | submit_button = _('Submit') |
---|
| 275 | action = POST_ACTION |
---|
| 276 | site_name = SITE_NAME |
---|
| 277 | currency = CURRENCY |
---|
[9392] | 278 | pay_item_id = '' |
---|
[8263] | 279 | product_id = PRODUCT_ID |
---|
[8256] | 280 | |
---|
| 281 | def update(self): |
---|
[8263] | 282 | if self.context.p_state != 'unpaid': |
---|
| 283 | self.flash(_("Payment ticket can't be re-send to CollegePAY.")) |
---|
| 284 | self.redirect(self.url(self.context, '@@index')) |
---|
| 285 | return |
---|
[8831] | 286 | if self.context.__parent__.__parent__.expired \ |
---|
| 287 | and self.context.__parent__.__parent__.strict_deadline: |
---|
[8706] | 288 | self.flash(_("Payment ticket can't be send to CollegePAY. " |
---|
| 289 | "Application period has expired.")) |
---|
| 290 | self.redirect(self.url(self.context, '@@index')) |
---|
| 291 | return |
---|
[8256] | 292 | self.applicant = self.context.__parent__ |
---|
[8276] | 293 | self.amount_auth = 100 * self.context.amount_auth |
---|
[8256] | 294 | xmldict = {} |
---|
[9408] | 295 | self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category] |
---|
[8281] | 296 | tz = getUtility(IKofaUtils).tzinfo |
---|
| 297 | self.local_date_time = to_timezone( |
---|
| 298 | self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z") |
---|
[8256] | 299 | self.site_redirect_url = self.url(self.context, 'request_webservice') |
---|
[8641] | 300 | xmldict['detail_ref'] = self.context.p_id |
---|
[8263] | 301 | # Provider data |
---|
[8644] | 302 | xmldict['provider_amt'] = 100 * 500 |
---|
[8263] | 303 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
| 304 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
| 305 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
| 306 | # Institution data |
---|
[8644] | 307 | xmldict['institution_amt'] = 100 * (self.context.amount_auth - 500 - 150) |
---|
[9387] | 308 | xmldict['institution_acct'] = '0' |
---|
| 309 | xmldict['institution_bank_id'] = '0' |
---|
[8263] | 310 | xmldict['institution_item_name'] = self.context.p_category |
---|
| 311 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
| 312 | # Interswitch amount is not part of the xml data |
---|
| 313 | xmltext = """<payment_item_detail> |
---|
| 314 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 315 | <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
| 316 | <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
| 317 | </item_details> |
---|
| 318 | </payment_item_detail>""" % xmldict |
---|
| 319 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
[8256] | 320 | return |
---|
| 321 | |
---|
[7894] | 322 | |
---|
[8256] | 323 | class InterswitchPaymentRequestWebservicePageStudent(UtilityView, grok.View): |
---|
[7919] | 324 | """ Request webservice view for the CollegePAY gateway |
---|
| 325 | """ |
---|
[8255] | 326 | grok.context(ICustomStudentOnlinePayment) |
---|
[7919] | 327 | grok.name('request_webservice') |
---|
| 328 | grok.require('waeup.payStudent') |
---|
| 329 | |
---|
| 330 | def update(self): |
---|
[8430] | 331 | ob_class = self.__implemented__.__name__ |
---|
[7919] | 332 | if self.context.p_state == 'paid': |
---|
| 333 | self.flash(_('This ticket has already been paid.')) |
---|
| 334 | return |
---|
[8745] | 335 | student = self.context.student |
---|
[8430] | 336 | success, msg, log = query_interswitch(self.context) |
---|
[8745] | 337 | student.writeLogMessage(self, log) |
---|
[8430] | 338 | if not success: |
---|
| 339 | self.flash(msg) |
---|
| 340 | return |
---|
| 341 | success, msg, log = self.context.doAfterStudentPayment() |
---|
| 342 | if log is not None: |
---|
[8745] | 343 | student.writeLogMessage(self, log) |
---|
[8430] | 344 | self.flash(msg) |
---|
[8256] | 345 | return |
---|
[7919] | 346 | |
---|
[8256] | 347 | def render(self): |
---|
| 348 | self.redirect(self.url(self.context, '@@index')) |
---|
| 349 | return |
---|
[7926] | 350 | |
---|
[8256] | 351 | class InterswitchPaymentRequestWebservicePageApplicant(UtilityView, grok.View): |
---|
| 352 | """ Request webservice view for the CollegePAY gateway |
---|
| 353 | """ |
---|
| 354 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 355 | grok.name('request_webservice') |
---|
| 356 | grok.require('waeup.payApplicant') |
---|
[7919] | 357 | |
---|
[8256] | 358 | def update(self): |
---|
| 359 | if self.context.p_state == 'paid': |
---|
| 360 | self.flash(_('This ticket has already been paid.')) |
---|
[7919] | 361 | return |
---|
[8256] | 362 | applicant = self.context.__parent__ |
---|
[8430] | 363 | success, msg, log = query_interswitch(self.context) |
---|
[8745] | 364 | applicant.writeLogMessage(self, log) |
---|
[8430] | 365 | if not success: |
---|
| 366 | self.flash(msg) |
---|
| 367 | return |
---|
| 368 | success, msg, log = self.context.doAfterApplicantPayment() |
---|
| 369 | if log is not None: |
---|
[8745] | 370 | applicant.writeLogMessage(self, log) |
---|
[8430] | 371 | self.flash(msg) |
---|
[7919] | 372 | return |
---|
| 373 | |
---|
| 374 | def render(self): |
---|
| 375 | self.redirect(self.url(self.context, '@@index')) |
---|
[9108] | 376 | return |
---|