Changeset 14616 for main


Ignore:
Timestamp:
9 Mar 2017, 10:42:42 (8 years ago)
Author:
Henrik Bettermann
Message:

Enable balance payments. Add gateway amount to balance amount. No other surcharges.

Location:
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
Files:
3 edited

Legend:

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

    r14329 r14616  
    126126        xmldict['institution_acct'] = '0838798044'
    127127        xmldict['institution_bank_id'] = '76'
    128         if self.context.p_category == 'schoolfee' \
     128        if self.context.p_item == 'Balance':
     129            self.pay_item_id = '000'
     130            dalash_amt = 0.0
     131            provider_amt = 0.0
     132            xmldict['institution_acct'] = '0838798044'
     133            xmldict['institution_bank_id'] = '76'
     134        elif self.context.p_category == 'schoolfee' \
    129135            or self.context.p_category.startswith('carryover'):
    130136            self.pay_item_id = '101'
     
    201207        # Interswitch amount is not part of the xml data
    202208
    203         if 'maintenance' in self.context.p_category:
     209        if 'maintenance' in self.context.p_category \
     210            or self.context.p_item == 'Balance':
    204211            xmltext = """<payment_item_detail>
    205212<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r14587 r14616  
    2828from waeup.kofa.fees import FeeTable
    2929from waeup.kofa.hostels.hostel import NOT_OCCUPIED
     30from waeup.kwarapoly.interswitch.browser import GATEWAY_AMT
    3031from waeup.kwarapoly.interfaces import MessageFactory as _
    3132
     
    277278        return None, payment
    278279
     280    def setBalanceDetails(self, category, student,
     281            balance_session, balance_level, balance_amount):
     282        """Create a balance payment ticket and set the payment data
     283        as selected by the student. Kwarapoly: Add Interswitch surcharge
     284        """
     285        p_item = u'Balance'
     286        p_session = balance_session
     287        p_level = balance_level
     288        p_current = False
     289        amount = balance_amount
     290        academic_session = self._getSessionConfiguration(p_session)
     291        if academic_session == None:
     292            return _(u'Session configuration object is not available.'), None
     293        if amount in (0.0, None) or amount < 0:
     294            return _('Amount must be greater than 0.'), None
     295        payment = createObject(u'waeup.StudentOnlinePayment')
     296        timestamp = ("%d" % int(time()*10000))[1:]
     297        payment.p_id = "p%s" % timestamp
     298        payment.p_category = category
     299        payment.p_item = p_item
     300        payment.p_session = p_session
     301        payment.p_level = p_level
     302        payment.p_current = p_current
     303        payment.amount_auth = amount + GATEWAY_AMT
     304        return None, payment
     305
    279306    def getAccommodationDetails(self, student):
    280307        """Determine the accommodation data of a student.
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/viewlets.py

    r12907 r14616  
    3535        return ''
    3636
    37 class AddBalancePaymentActionButton(AddBalancePaymentActionButton):
     37#class AddBalancePaymentActionButton(AddBalancePaymentActionButton):
    3838
    39     @property
    40     def target_url(self):
    41         return ''
     39#    @property
     40#    def target_url(self):
     41#        return ''
    4242
    4343class AdmissionNotificationActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.