Ignore:
Timestamp:
5 Oct 2020, 13:19:29 (4 years ago)
Author:
Henrik Bettermann
Message:

provider_amt has already to be stored when creating the payment ticket. Otherwise students will go to the bank and pay without this fee.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py

    r16261 r16270  
    159159        # Already now it becomes an Etranzact payment. We set the net amount
    160160        # and add the gateway amount.
    161         provider_amt = 0.0
    162         if self.context.p_category in (
    163             'registration', 'required_combi', 'pg_other'):
    164             provider_amt = 5000.0
    165         if not self.context.r_company:
    166             self.context.net_amt = self.context.amount_auth
    167             self.context.amount_auth += self.gateway_amt
    168             self.context.amount_auth += provider_amt
    169             self.context.gateway_amt = self.gateway_amt
    170             self.context.provider_amt = provider_amt
     161        if not self.context.r_company:
     162            self.context.net_amt = self.context.amount_auth
     163            self.context.amount_auth += self.gateway_amt
     164            self.context.gateway_amt = self.gateway_amt
    171165            self.context.r_company = u'etranzact'
    172166        self.amount = "%.1f" % self.context.amount_auth
     
    222216        # Already now it becomes an Etranzact payment. We set the net amount
    223217        # and add the gateway amount.
    224         provider_amt = 0.0
    225         if self.context.p_category in (
    226             'registration', 'required_combi', 'pg_other'):
    227             provider_amt = 5000.0
    228         if not self.context.r_company:
    229             self.context.net_amt = self.context.amount_auth
    230             self.context.amount_auth += self.gateway_amt
    231             self.context.amount_auth += provider_amt
    232             self.context.gateway_amt = self.gateway_amt
    233             self.context.provider_amt = provider_amt
     218        if not self.context.r_company:
     219            self.context.net_amt = self.context.amount_auth
     220            self.context.amount_auth += self.gateway_amt
     221            self.context.gateway_amt = self.gateway_amt
    234222            self.context.r_company = u'etranzact'
    235223        return
     
    248236        # Already now it becomes an Etranzact payment. We set the net amount
    249237        # and add the gateway amount.
    250         provider_amt = 0.0
    251         if not self.context.r_company:
    252             self.context.net_amt = self.context.amount_auth
    253             self.context.amount_auth += self.gateway_amt
    254             self.context.amount_auth += provider_amt
    255             self.context.gateway_amt = self.gateway_amt
    256             self.context.provider_amt = provider_amt
     238        if not self.context.r_company:
     239            self.context.net_amt = self.context.amount_auth
     240            self.context.amount_auth += self.gateway_amt
     241            self.context.gateway_amt = self.gateway_amt
    257242            self.context.r_company = u'etranzact'
    258243        return
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py

    r16233 r16270  
    126126        xmldict['institution_item_name'] = self.context.category
    127127        xmldict['institution_name'] = INSTITUTION_NAME
    128         xmldict['institution_amt'] = 100 * self.context.net_amt
    129         if not self.context.provider_amt:
    130             self.context.provider_amt = provider_amt
    131             self.context.amount_auth += provider_amt
     128        xmldict['institution_amt'] = 100 * self.context.net_amt - (
     129            100 * provider_amt)
    132130        if provider_amt == 0:
    133131            xmltext = """<payment_item_detail>
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py

    r16137 r16270  
    5353
    5454    def test_interswitch_form(self):
    55         self.app['configuration']['2004'].registration_fee = 2000.0
     55        self.app['configuration']['2004'].registration_fee = 7000.0
    5656        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    5757        self.browser.open(self.payments_path)
     
    6262        self.browser.getControl("Create payment").click()
    6363        self.assertTrue('Payment created' in self.browser.contents)
     64        self.browser.open(self.payments_path)
    6465        ctrl = self.browser.getControl(name='val_id')
    6566        self.value = ctrl.options[0]
    6667        self.browser.getLink(self.value).click()
    6768        self.assertTrue(
    68             '<span>2000.0</span>' in self.browser.contents)
     69            '<span>7000.0</span>' in self.browser.contents)
    6970        self.payment_url = self.browser.url
    7071        self.browser.getLink("Pay via Interswitch", index=0).click()
     
    7576        payment = self.student['payments'][self.value]
    7677        self.assertEqual(payment.amount_auth, 7250)
    77         self.assertEqual(payment.net_amt, 2000)
     78        self.assertEqual(payment.net_amt, 7000)
    7879        self.assertTrue(
    7980            '<input type="hidden" name="amount" value="725000" />' in
    8081            self.browser.contents)
     82        # WAeAC charge have been substracted
    8183        self.assertTrue(
    8284            'item_name="Registration Fee" item_amt="200000" bank_id="117" acct_num="1011050158"' in
     85            self.browser.contents)
     86        self.assertTrue(
     87            'item_name="WAeAC" item_amt="500000" bank_id="31" acct_num="0773411069"' in
    8388            self.browser.contents)
    8489
     
    99104                           self.browser.contents)
    100105        self.assertEqual(self.student.current_mode, 'ug_ft')
    101         # 5000 provider charge and 250 gateway charge have been added
    102         self.assertTrue(
    103             '<input type="hidden" name="amount" value="625000" />' in
    104             self.browser.contents)
    105         self.assertEqual(acc_payment.amount_auth, 6250)
     106        # 250 gateway charge have been added
     107        self.assertTrue(
     108            '<input type="hidden" name="amount" value="125000" />' in
     109            self.browser.contents)
     110        self.assertEqual(acc_payment.amount_auth, 1250)
    106111        self.assertEqual(acc_payment.net_amt, 1000)
    107112        delta = timedelta(days=8)
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py

    r16257 r16270  
    247247        payment = createObject(u'waeup.StudentOnlinePayment')
    248248        timestamp = ("%d" % int(time()*10000))[1:]
     249        if category in (
     250            'registration', 'required_combi', 'pg_other'):
     251            payment.provider_amt = 5000.0
     252        if category in (
     253            'schoolfee', 'schoolfee40') and student.is_jupeb:
     254            payment.provider_amt = 5000.0
    249255        payment.p_id = "p%s" % timestamp
    250256        payment.p_category = category
Note: See TracChangeset for help on using the changeset viewer.