Ignore:
Timestamp:
6 Nov 2019, 07:25:16 (5 years ago)
Author:
Henrik Bettermann
Message:

Adjust to changes in nigeria package.

File:
1 edited

Legend:

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

    r15615 r15756  
    2323    EtranzactPageStudent, EtranzactReceiveResponseStudent,
    2424    EtranzactRequestPaymentStatusPageStudent)
     25from kofacustom.nigeria.etranzact.payoutletbrowser import (
     26    EtranzactEnterPinPageStudent, EtranzactEnterPinPageApplicant,
     27    EtranzactQueryHistoryPageStudent, EtranzactQueryHistoryPageApplicant)
     28from kofacustom.nigeria.etranzact.payoutletwebservice  import NigeriaPaymentDataWebservice
    2529
    2630# Temporarily we can use the test portal like in kofacustom.nigeria
    2731
    2832from kofacustom.nigeria.etranzact.tests import (
    29     HOST, HTTPS, SECRET_KEY, TERMINAL_ID)
     33    HOST, HTTPS, SECRET_KEY, TERMINAL_ID, GATEWAY_AMT)
    3034
    3135#HOST =
     
    3337#SECRET_KEY =
    3438#TERMINAL_ID =
     39#GATEWAY_AMT =
    3540LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
    3641
     
    4247    terminal_id = TERMINAL_ID
    4348    logo_url = LOGO_URL
     49    gateway_amt = GATEWAY_AMT
     50
     51    def update(self):
     52        # Already now it becomes an Etranzact payment. We set the net amount
     53        # and add the gateway amount.
     54        if not self.context.r_company:
     55            self.context.net_amt = self.context.amount_auth
     56            self.context.amount_auth += self.gateway_amt
     57            self.context.gateway_amt = self.gateway_amt
     58            self.context.r_company = u'etranzact'
     59        self.amount = "%.1f" % self.context.amount_auth
     60        error = self.init_update()
     61        if error:
     62            self.flash(error, type='danger')
     63            self.redirect(self.url(self.context, '@@index'))
     64            return
     65        return
    4466
    4567class CustomEtranzactReceiveResponseApplicant(EtranzactReceiveResponseApplicant):
     
    6486    terminal_id = TERMINAL_ID
    6587    logo_url = LOGO_URL
     88    gateway_amt = GATEWAY_AMT
     89
     90    def update(self):
     91        # Already now it becomes an Etranzact payment. We set the net amount
     92        # and add the gateway amount.
     93        if not self.context.r_company:
     94            self.context.net_amt = self.context.amount_auth
     95            self.context.amount_auth += self.gateway_amt
     96            self.context.gateway_amt = self.gateway_amt
     97            self.context.r_company = u'etranzact'
     98        self.amount = "%.1f" % self.context.amount_auth
     99        error = self.init_update()
     100        if error:
     101            self.flash(error, type='danger')
     102            self.redirect(self.url(self.context, '@@index'))
     103            return
     104        return
    66105
    67106class CustomEtranzactReceiveResponseStudent(EtranzactReceiveResponseStudent):
     
    79118    logo_url = LOGO_URL
    80119
     120# Payoutlet customizations
    81121
     122class CustomEtranzactEnterPinPageStudent(EtranzactEnterPinPageStudent):
     123    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageStudent`
     124    """
     125    gateway_amt = GATEWAY_AMT
    82126
     127class CustomEtranzactEnterPinPageApplicant(EtranzactEnterPinPageApplicant):
     128    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageApplicant`
     129    """
     130    gateway_amt = GATEWAY_AMT
     131
     132class CustomEtranzactQueryHistoryPageStudent(EtranzactQueryHistoryPageStudent):
     133    """ Query history of Etranzact payments
     134    """
     135    terminal_id = TERMINAL_ID
     136    host = HOST
     137    https = HTTPS
     138
     139class CustomEtranzactQueryHistoryPageApplicant(EtranzactQueryHistoryPageApplicant):
     140    """ Query history of Etranzact payments
     141    """
     142    terminal_id = TERMINAL_ID
     143    host = HOST
     144    https = HTTPS
     145
     146class CustomPaymentDataWebservice(NigeriaPaymentDataWebservice):
     147    """A simple webservice to publish payment and payer details on request from
     148    accepted IP addresses without authentication.
     149    """
     150    #ACCEPTED_IP = ('195.219.3.181', '195.219.3.184')
     151    ACCEPTED_IP = None
     152
     153    CATEGORY_MAPPING = {
     154        'SCHOOLFEE': ('schoolfee',),
     155         }
     156
Note: See TracChangeset for help on using the changeset viewer.