Ignore:
Timestamp:
5 Nov 2019, 23:19:58 (5 years ago)
Author:
Henrik Bettermann
Message:

Prepare all payment gateway modules for net amount fee configuration. In the future, provider and gateway surcharges will be determined and added just before the data are being send to the gateways for the first time.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/applicantsbrowser.py

    r15529 r15755  
    3434
    3535from kofacustom.nigeria.remita.tests import (
    36     MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
     36    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT)
    3737
    3838grok.templatedir('browser_templates')
     
    235235        if self.context.p_state == 'paid':
    236236            return _("Payment ticket can't be re-sent to Remita.")
     237        if self.context.r_company and self.context.r_company != 'remita':
     238            return _("Payment ticket has been used for another payment gateway.")
    237239        now = datetime.utcnow()
    238240        if self.context.creation_date.tzinfo is not None:
     
    260262        if resp.get('statuscode') not in ('021', '025', '055'):
    261263            return 'RRR generation message from Remita: ' + resp.get('status')
    262         # Already now it becomes a Remita payment
    263         self.context.r_company = u'remita'
    264264        self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip()
    265265        hashargs =      self.merchantId + self.rrr + self.api_key
     
    269269            'RRR retrieved: %s, ServiceTypeId: %s'
    270270            % (self.rrr, self.serviceTypeId))
    271 
    272271        return
    273272
     
    281280            self.redirect(self.url(self.context, '@@index'))
    282281            return
    283         return
     282        # Already now it becomes a Remita payment. We set the net amount
     283        # and add the gateway amount.
     284        if not self.context.r_company:
     285            self.context.net_amt = self.context.amount_auth
     286            self.context.amount_auth += self.gateway_amt
     287            self.context.gateway_amt = self.gateway_amt
     288            self.context.r_company = u'remita'
     289        self.amount_auth = int(100 * self.context.amount_auth)
     290        return
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py

    r14805 r15755  
    3434
    3535from kofacustom.nigeria.remita.tests import (
    36     MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
     36    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT)
    3737
    3838grok.templatedir('browser_templates')
     
    221221    api_key = API_KEY
    222222    serviceTypeId = SERVICETYPEID
     223    gateway_amt = GATEWAY_AMT
    223224
    224225    #orderId = '3456346346'
     
    243244        if self.context.p_state == 'paid':
    244245            return _("Payment ticket can't be re-sent to Remita.")
     246        if self.context.r_company and self.context.r_company != 'remita':
     247            return _("Payment ticket has been used for another payment gateway.")
    245248        now = datetime.utcnow()
    246249        if self.context.creation_date.tzinfo is not None:
     
    276279        if resp.get('statuscode') not in ('021', '025', '055'):
    277280            return 'RRR generation message from Remita: ' + resp.get('status')
    278         # Already now it becomes a Remita payment
    279         self.context.r_company = u'remita'
    280281        self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip()
    281282        hashargs =      self.merchantId + self.rrr + self.api_key
     
    296297            self.redirect(self.url(self.context, '@@index'))
    297298            return
    298         return
     299        # Already now it becomes a Remita payment. We set the net amount
     300        # and add the gateway amount.
     301        if not self.context.r_company:
     302            self.context.net_amt = self.context.amount_auth
     303            self.context.amount_auth += self.gateway_amt
     304            self.context.gateway_amt = self.gateway_amt
     305            self.context.r_company = u'remita'
     306        self.amount_auth = int(100 * self.context.amount_auth)
     307        return
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py

    r15468 r15755  
    4444API_KEY = '1946'
    4545SERVICETYPEID = '4430731'
     46GATEWAY_AMT = 0.0
    4647
    4748def external_test(func):
     
    8687                lineitems=self.lineitems)
    8788        return resp
     89
     90    def test_dummytest(self):
     91        return
    8892
    8993    @external_test
Note: See TracChangeset for help on using the changeset viewer.