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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py

    r15702 r15755  
    3333
    3434from kofacustom.nigeria.etranzact.tests import (
    35     TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL)
     35    TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT)
    3636
    3737grok.templatedir('browser_templates')
     
    9393    terminal_id = TERMINAL_ID
    9494    logo_url = LOGO_URL
     95    gateway_amt = GATEWAY_AMT
    9596
    9697    @property
     
    101102
    102103    def init_update(self):
     104        if not module_activated(self.context.student.current_session):
     105            return _("Etranzact payments deactivated.")
    103106        if self.context.p_state == 'paid':
    104107            return _("Payment ticket can't be re-sent to Etranzact.")
     
    116119        # which authenticates the response.
    117120        self.responseurl = self.url(self.context, 'receive_etranzact')
    118         # Already now it becomes a Etranzact payment
    119         self.context.r_company = u'etranzact'
    120         hashargs =      self.amount + self.terminal_id+self.transaction_id \
     121        self.transaction_id = self.context.p_id
     122        hashargs =      self.amount + self.terminal_id + self.transaction_id \
    121123            + self.responseurl + self.secret_key
    122124        self.hashvalue = hashlib.md5(hashargs).hexdigest()
     
    125127
    126128    def update(self):
    127         if not module_activated(self.context.student.current_session):
    128             return
    129         self.transaction_id = self.context.p_id
     129        # Already now it becomes an Etranzact payment. We set the net amount
     130        # and add the gateway amount.
     131        if not self.context.r_company:
     132            self.context.net_amt = self.context.amount_auth
     133            self.context.amount_auth += self.gateway_amt
     134            self.context.gateway_amt = self.gateway_amt
     135            self.context.r_company = u'etranzact'
    130136        self.amount = "%.1f" % self.context.amount_auth
    131137        error = self.init_update()
Note: See TracChangeset for help on using the changeset viewer.