Ignore:
Timestamp:
21 May 2015, 17:05:42 (9 years ago)
Author:
Henrik Bettermann
Message:

To guarantee that cleared students pay both acceptance fees and
school fees, a school fee payment POST request to the Interswitch
CollegePAY payment gateway can only be sent if
acceptance/clearance fee has been successfully queried/paid
beforehand. This requirement applies to students in state 'cleared'
and entry_session greater than 2013 only, see ticket #119.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py

    r12730 r12975  
    2121from zope.interface import Interface
    2222from zope.component import queryAdapter
     23from waeup.kofa.interfaces import CLEARED
    2324from kofacustom.nigeria.interswitch.browser import (
    2425    InterswitchPaymentRequestWebservicePageStudent,
     
    6869    def update(self):
    6970
    70         super(CustomInterswitchPageApplicant, self).update()
     71        error = self.init_update()
     72        if error:
     73            self.flash(error, type='danger')
     74            self.redirect(self.url(self.context, '@@index'))
     75            return
    7176        xmldict = {}
    7277        provider_amt = 1000.0
     
    116121
    117122    def update(self):
    118         #self.flash('Payment method not yet configured.', type='danger')
    119         #self.redirect(self.url(self.context, '@@index'))
    120         #return
    121         super(CustomInterswitchPageStudent, self).update()
     123        error = self.init_update()
     124        if error:
     125            self.flash(error, type='danger')
     126            self.redirect(self.url(self.context, '@@index'))
     127            return
    122128        student = self.student
     129
     130        # To guarantee that cleared students pay both acceptance fee
     131        # and school fees, the page can only be accessed
     132        # for school fee payments if acceptance/clearance fee has
     133        # been successfully queried/paid beforehand. This
     134        # requirement applies to students in state 'cleared' and
     135        # entry_session greater than 2013 only.
     136        if self.context.p_category == 'schoolfee' and \
     137            student.state == CLEARED and \
     138            student.entry_session > 2012:
     139            acceptance_fee_paid = False
     140            for ticket in student['payments'].values():
     141                if ticket.p_state == 'paid' and \
     142                    ticket.p_category == 'clearance':
     143                    acceptance_fee_paid = True
     144                    break
     145            if not acceptance_fee_paid:
     146                self.flash(
     147                    _('Please pay acceptance fee first.'), type="danger")
     148                self.redirect(self.url(self.context, '@@index'))
     149                return
     150
    123151        xmldict = self.xmldict
    124152        xmltext = ""
Note: See TracChangeset for help on using the changeset viewer.