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

Split utme application payments.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/interswitch
Files:
2 edited

Legend:

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

    r14121 r14122  
    116116<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" />
    117117<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        elif self.applicant.applicant_id.startswith('utme'):
     122            provider_amt = 1000.0
     123            screening_guide_amount = 2000.0
     124            xmldict['provider_amt'] = 100 * provider_amt
     125            xmldict['screening_guide_amount'] = 100 * screening_guide_amount
     126            xmldict['institution_amt'] = 100 * (
     127                self.context.amount_auth - provider_amt - screening_guide_amount -GATEWAY_AMT)
     128            xmltext = """<payment_item_detail>
     129<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
     130<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" />
     131<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" />
     132<item_detail item_id="3" item_name="Screening Guide" item_amt="%(screening_guide_amount)d" bank_id="117" acct_num="1013879579" />
    118133</item_details>
    119134</payment_item_detail>""" % xmldict
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py

    r14121 r14122  
    116116        self.assertTrue(
    117117            'item_name="PG Handbook" item_amt="200000" bank_id="117" acct_num="1014270207"'
     118            in self.browser.contents)
     119        self.assertTrue(
     120            '<input type="hidden" name="product_id" value="5845" />'
     121            in self.browser.contents)
     122        delta = timedelta(days=8)
     123        self.applicant.values()[0].creation_date -= delta
     124        self.browser.open(self.payment_url)
     125        self.browser.getLink("CollegePAY", index=0).click()
     126        self.assertTrue(
     127            'This payment ticket is too old. Please create a new ticket'
     128            in self.browser.contents)
     129
     130    def test_interswitch_form_utme(self):
     131        self.applicant.applicant_id = u'utme_anything'
     132        self.browser.getControl("Add online").click()
     133        self.assertTrue('ticket created' in self.browser.contents)
     134        #self.browser.getLink(value).click()
     135        self.assertTrue('Amount Authorized' in self.browser.contents)
     136        self.assertTrue('<span>10000.0</span>' in self.browser.contents)
     137        self.payment_url = self.browser.url
     138        # Manager can access InterswitchForm
     139        self.browser.getLink("CollegePAY", index=0).click()
     140        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
     141        self.assertTrue(
     142            '<input type="hidden" name="amount" value="1000000" />'
     143            in self.browser.contents)
     144        self.assertTrue(
     145            'item_name="BT Education" item_amt="100000"'
     146            in self.browser.contents)
     147        self.assertTrue(
     148            'item_name="Application Fee" item_amt="675000" bank_id="117" acct_num="1010835352"'
     149            in self.browser.contents)
     150        self.assertTrue(
     151            'item_name="Screening Guide" item_amt="200000" bank_id="117" acct_num="1013879579"'
    118152            in self.browser.contents)
    119153        self.assertTrue(
Note: See TracChangeset for help on using the changeset viewer.