Changeset 13606


Ignore:
Timestamp:
12 Jan 2016, 17:18:53 (9 years ago)
Author:
Henrik Bettermann
Message:

Each product has its own MAC key.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py

    r13586 r13606  
    4747URL = '/paydirect/api/v1/gettransaction.json'
    4848HTTPS = True
    49 MAC = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     49MAC_REGULAR = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     50MAC_PT = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
    5051
    5152httplib.HTTPSConnection.debuglevel = 0
     
    7778    site_name = SITE_NAME
    7879    currency = CURRENCY
    79     mac = MAC
    8080
    8181    def update(self):
     
    8989            self.product_id = PRODUCT_ID_PT
    9090            self.pay_item_id = '101'
     91            self.mac = MAC_PT
    9192        else:
    9293            self.product_id = PRODUCT_ID_REGULAR
    9394            self.pay_item_id = '109'
     95            self.mac = MAC_REGULAR
    9496        xmldict = {}
    9597        provider_amt = 1000.0
     
    136138    currency = CURRENCY
    137139    #pay_item_id = '101'
    138     mac = MAC
    139140
    140141    def update(self):
     
    161162        if contr_agreement_student(student) == 'first':
    162163            self.product_id = PRODUCT_ID_PT
     164            self.mac = MAC_PT
    163165        else:
    164166            self.product_id = PRODUCT_ID_REGULAR
     167            self.mac = MAC_REGULAR
    165168
    166169        # To guarantee that cleared students pay both acceptance fee
     
    420423    gateway_url = URL
    421424    https = HTTPS
    422     mac = MAC
     425
     426    @property
     427    def mac(self):
     428        if contr_agreement_applicant(self.context.__parent__) == 'first':
     429            return MAC_PT
     430        return MAC_REGULAR
    423431
    424432    @property
     
    436444    gateway_url = URL
    437445    https = HTTPS
    438     mac = MAC
     446
     447    @property
     448    def mac(self):
     449        if contr_agreement_applicant(self.context.__parent__) == 'first':
     450            return MAC_PT
     451        return MAC_REGULAR
    439452
    440453    @property
     
    452465    gateway_url = URL
    453466    https = HTTPS
    454     mac = MAC
     467
     468    @property
     469    def mac(self):
     470        if contr_agreement_student(self.context.student) == 'first':
     471            return MAC_PT
     472        return MAC_REGULAR
    455473
    456474    @property
     
    468486    gateway_url = URL
    469487    https = HTTPS
    470     mac = MAC
     488
     489    @property
     490    def mac(self):
     491        if contr_agreement_student(self.context.student) == 'first':
     492            return MAC_PT
     493        return MAC_REGULAR
    471494
    472495    @property
Note: See TracChangeset for help on using the changeset viewer.