Ignore:
Timestamp:
24 Aug 2016, 06:03:58 (8 years ago)
Author:
Henrik Bettermann
Message:

Split pg application payments.

File:
1 edited

Legend:

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

    r14088 r14121  
    103103        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    104104        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    105         xmldict['institution_amt'] = 100 * (
    106             self.context.amount_auth - provider_amt - GATEWAY_AMT)
    107105        xmldict['institution_item_name'] = self.category
    108106        xmldict['institution_name'] = INSTITUTION_NAME
    109         # Interswitch amount is not part of the xml data
    110         xmltext = """<payment_item_detail>
     107
     108        if self.applicant.applicant_id.startswith('pg'):
     109            handbook_amount = 2000.0
     110            xmldict['handbook_amount'] = 100 * handbook_amount
     111            xmldict['institution_amt'] = 100 * (
     112                self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT)
     113            xmltext = """<payment_item_detail>
    111114<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
    112115<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" />
    113116<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" />
    114 </item_details>
    115 </payment_item_detail>""" % xmldict
     117<item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="117" acct_num="1014270207" />
     118</item_details>
     119</payment_item_detail>""" % xmldict
     120
     121        else:
     122            xmldict['institution_amt'] = 100 * (
     123                self.context.amount_auth - provider_amt - GATEWAY_AMT)
     124            xmltext = """<payment_item_detail>
     125<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
     126<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" />
     127<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" />
     128</item_details>
     129</payment_item_detail>""" % xmldict
     130
    116131        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    117132        self.context.provider_amt = provider_amt
Note: See TracChangeset for help on using the changeset viewer.