Ignore:
Timestamp:
10 Aug 2017, 06:43:59 (7 years ago)
Author:
Henrik Bettermann
Message:

Define MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID in one place.

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

Legend:

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

    r14779 r14790  
    3333from kofacustom.nigeria.remita.studentsbrowser import module_activated
    3434
     35from kofacustom.nigeria.remita.tests import (
     36    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
     37
    3538grok.templatedir('browser_templates')
    3639
     
    99102
    100103    # Here we use Remita test portal data
    101     merchantId = '2547916'
    102     host = 'www.remitademo.net'
    103     https = False
    104     api_key = '1946'
     104    merchantId = MERCHANTID
     105    host = HOST
     106    https = HTTPS
     107    api_key = API_KEY
    105108
    106109    def update(self):
     
    152155
    153156    # Here we use Remita test portal data
    154     merchantId = '2547916'
    155     host = 'www.remitademo.net'
    156     https = False
    157     api_key = '1946'
     157    merchantId = MERCHANTID
     158    host = HOST
     159    https = HTTPS
     160    api_key = API_KEY
    158161
    159162    def update(self):
     
    206209    label = _('Pay via Remita')
    207210    submit_button = _('Pay now')
    208     https = False
    209211
    210212    # Here we use Remita test portal data
    211     merchantId = '2547916'
    212     serviceTypeId = '4430731'
    213     api_key = '1946'
     213    merchantId = MERCHANTID
     214    host = HOST
     215    https = HTTPS
     216    api_key = API_KEY
     217    serviceTypeId = SERVICETYPEID
     218
    214219    orderId = '3456346346'
    215     host = 'www.remitademo.net'
    216220    init_url = '/remita/ecomm/split/init.reg'
    217221    amount='1000'
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py

    r14779 r14790  
    3333from kofacustom.nigeria.interfaces import MessageFactory as _
    3434
     35from kofacustom.nigeria.remita.tests import (
     36    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
     37
    3538grok.templatedir('browser_templates')
    3639
     
    107110
    108111    # Here we use Remita test portal data
    109     merchantId = '2547916'
    110     host = 'www.remitademo.net'
    111     https = False
    112     api_key = '1946'
     112    merchantId = MERCHANTID
     113    host = HOST
     114    https = HTTPS
     115    api_key = API_KEY
    113116
    114117    def update(self):
     
    160163
    161164    # Here we use Remita test portal data
    162     merchantId = '2547916'
    163     host = 'www.remitademo.net'
    164     https = False
    165     api_key = '1946'
     165    merchantId = MERCHANTID
     166    host = HOST
     167    https = HTTPS
     168    api_key = API_KEY
    166169
    167170    def update(self):
     
    214217    label = _('Pay via Remita')
    215218    submit_button = _('Pay now')
    216     https = False
    217219
    218220    # Here we use Remita test portal data
    219     merchantId = '2547916'
    220     serviceTypeId = '4430731'
    221     api_key = '1946'
     221    merchantId = MERCHANTID
     222    host = HOST
     223    https = HTTPS
     224    api_key = API_KEY
     225    serviceTypeId = SERVICETYPEID
     226
    222227    orderId = '3456346346'
    223     host = 'www.remitademo.net'
    224228    init_url = '/remita/ecomm/split/init.reg'
    225229    amount='1000'
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py

    r14788 r14790  
    3838EXTERNAL_TESTS = True
    3939
     40MERCHANTID = '2547916'
     41HOST = 'www.remitademo.net'
     42HTTPS = False
     43API_KEY = '1946'
     44SERVICETYPEID = '4430731'
     45
    4046def external_test(func):
    4147    if not EXTERNAL_TESTS:
     
    5056class HelperTests(unittest.TestCase):
    5157
    52     merchantId = '2547916'
    53     serviceTypeId = '4430731'
    54     api_key = '1946'
     58    merchantId = MERCHANTID
     59    host = HOST
     60    https = HTTPS
     61    api_key = API_KEY
     62    serviceTypeId = SERVICETYPEID
     63
    5564    responseurl = 'http://xxxx'
    56     host = 'www.remitademo.net'
     65
    5766    url = '/remita/ecomm/split/init.reg'  # /remita/ecomm/v2/init.reg
    5867    lineitems = (
     
    7281                api_key=self.api_key, orderId=self.orderId,
    7382                amount=self.amount, responseurl=self.responseurl,
    74                 host=self.host, url=self.url, https=False,
     83                host=self.host, url=self.url, https=self.https,
    7584                fullname='Anton Meier', email='am@xxx.de',
    7685                lineitems=self.lineitems)
     
    8493                api_key=self.api_key, orderId=self.orderId,
    8594                amount=self.amount, responseurl=self.responseurl,
    86                 host=self.host, url=self.url, https=False,
     95                host=self.host, url=self.url, https=self.https,
    8796                fullname='Anton Meier', email='am@xxx.de',
    8897                lineitems=self.lineitems)
     
    99108                RRR=self.rrr,
    100109                host=self.host,
    101                 https=False,
     110                https=self.https,
    102111                )
    103112        assert resp['orderId'] == self.orderId
     
    116125    layer = FunctionalLayer
    117126
    118     merchantId = '2547916'
    119     serviceTypeId = '4430731'
    120     api_key = '1946'
     127    merchantId = MERCHANTID
     128    host = HOST
     129    https = HTTPS
     130    api_key = API_KEY
     131
    121132    responseurl = 'http://xxxx'
    122     host = 'www.remitademo.net'
    123133
    124134    # successful transaction
     
    162172            RRR=self.rrr_p,
    163173            host=self.host,
    164             https=False,
     174            https=self.https,
    165175            verify=False)
    166176        assert qr == (
     
    179189            RRR=self.rrr,
    180190            host=self.host,
    181             https=False,
     191            https=self.https,
    182192            verify=False)
    183193        assert qr[0] == True
     
    232242    layer = FunctionalLayer
    233243
    234     merchantId = '2547916'
    235     serviceTypeId = '4430731'
    236     api_key = '1946'
     244    merchantId = MERCHANTID
     245    host = HOST
     246    https = HTTPS
     247    api_key = API_KEY
     248
    237249    responseurl = 'http://xxxx'
    238     host = 'www.remitademo.net'
    239250
    240251    # successful transaction
     
    288299    layer = FunctionalLayer
    289300
    290     merchantId = '2547916'
    291     serviceTypeId = '4430731'
    292     api_key = '1946'
     301    merchantId = MERCHANTID
     302    host = HOST
     303    https = HTTPS
     304    api_key = API_KEY
     305
    293306    responseurl = 'http://xxxx'
    294     host = 'www.remitademo.net'
    295307
    296308    # successful transaction
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/webservices.py

    r14788 r14790  
    3333    grok.require('waeup.Public')
    3434
    35     ACCEPTED_IP = None
     35    ACCEPTED_IP = ('127.0.0.1',)
    3636
    3737    # Here we use Remita test portal data
Note: See TracChangeset for help on using the changeset viewer.