Ignore:
Timestamp:
6 Dec 2012, 08:42:16 (12 years ago)
Author:
Henrik Bettermann
Message:

Store provider_amt and gateway_amt when opening goto_interswitch pages.

Both fileds must be invisible on display pages and pdf slips.

File:
1 edited

Legend:

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

    r9749 r9775  
    1919import grok
    2020from zope.component import getUtility
    21 from kofacustom.nigeria.interswitch.helpers import query_interswitch
     21from kofacustom.nigeria.interswitch.helpers import (
     22    query_interswitch, write_payments_log)
    2223from waeup.kofa.browser.layout import KofaPage, UtilityView
    2324from waeup.kofa.interfaces import IKofaUtils
     
    3637INSTITUTION_NAME = 'Uniben'
    3738CURRENCY = '566'
     39GATEWAY_AMT = 150.0
    3840#QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx'
    3941#QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx'
     
    156158        xmldict['institution_amt'] = '0.0'
    157159        if self.context.p_category == 'schoolfee':
    158             provider_amt = 1500
     160            provider_amt = 1500.0
    159161            if student.current_mode.endswith('_ft'):
    160162                self.pay_item_id = '5700'
     
    181183        elif self.context.p_category == 'clearance':
    182184            self.pay_item_id = '5702'
    183             provider_amt = 1500
     185            provider_amt = 1500.0
    184186            if student.current_mode == 'pg_ft':
    185187                xmldict['institution_acct'] = '5330832799'
     
    196198        elif self.context.p_category == 'gown':
    197199            self.pay_item_id = '5704'
    198             provider_amt = 0
     200            provider_amt = 0.0
    199201            xmldict['institution_bank_id'] = '7'
    200202            xmldict['institution_acct'] = '1016232382'
    201203        elif self.context.p_category.startswith('hostel_maintenance'):
    202204            self.pay_item_id = '5705'
    203             provider_amt = 0
     205            provider_amt = 0.0
    204206            xmldict['institution_bank_id'] = '129'
    205207            xmldict['institution_acct'] = '0014414547'
     
    209211        xmldict['institution_name'] = INSTITUTION_NAME
    210212        xmldict['institution_amt'] = 100 * (
    211             self.context.amount_auth - provider_amt - 150)
     213            self.context.amount_auth - provider_amt - GATEWAY_AMT)
    212214        # Interswitch amount is not part of the xml data
    213215        if provider_amt == 0:
     
    225227</payment_item_detail>""" % xmldict
    226228        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
     229        self.context.provider_amt = provider_amt
     230        self.context.gateway_amt = GATEWAY_AMT
    227231        return
    228232
     
    262266            self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z")
    263267        self.site_redirect_url = self.url(self.context, 'request_webservice')
    264         provider_amt = 400
     268        provider_amt = 400.0
    265269        if self.applicant.applicant_id.startswith('pg'):
    266270            xmldict['institution_acct'] = '0031716030'
     
    277281        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    278282        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    279         xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - 150)
     283        xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT)
    280284        xmldict['institution_item_name'] = self.context.p_category
    281285        xmldict['institution_name'] = INSTITUTION_NAME
     
    288292</payment_item_detail>""" % xmldict
    289293        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
     294        self.context.provider_amt = provider_amt
     295        self.context.gateway_amt = GATEWAY_AMT
    290296        return
    291297
     
    368374            self.flash(msg)
    369375            return
     376        write_payments_log(student.student_id, self.context)
    370377        success, msg, log = self.context.doAfterStudentPayment()
    371378        if log is not None:
     
    396403            self.flash(msg)
    397404            return
     405        write_payments_log(applicant.applicant_id, self.context)
    398406        success, msg, log = self.context.doAfterApplicantPayment()
    399407        if log is not None:
Note: See TracChangeset for help on using the changeset viewer.