Ignore:
Timestamp:
23 Oct 2012, 08:24:31 (12 years ago)
Author:
Henrik Bettermann
Message:

Configure Interswitch module with hash value in form.

File:
1 edited

Legend:

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

    r9387 r9392  
    1919import httplib
    2020import urllib
     21import hashlib
    2122from xml.dom.minidom import parseString
    2223import grok
     
    4243#QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx'
    4344#QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx'
     45
    4446#POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx'
    4547POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'
     
    4749#HOST = 'webpay.interswitchng.com'
    4850HOST = 'testwebpay.interswitchng.com'
     51
    4952#URL = '/paydirect/services/TransactionQueryWs.asmx'
    5053URL = '/test_paydirect/services/TransactionQueryWs.asmx'
     
    180183    pay_item_id = '101'
    181184    product_id = PRODUCT_ID
     185    mac = '737396C271FB8E2BA1A612A942267553E16373658A5F83D90DAFFBB806C16E9E6284006C06CEFFB55768004179D7BC01CD237CCE6314B938A5A5D9F49369DE5A'
    182186
    183187    def update(self):
     
    235239        xmldict['institution_item_name'] = self.context.p_category
    236240        xmldict['institution_name'] = INSTITUTION_NAME
     241
     242        hashargs = (
     243            self.context.p_id +
     244            PRODUCT_ID +
     245            self.pay_item_id +
     246            str(int(self.amount_auth)) +
     247            self.site_redirect_url +
     248            self.mac)
     249        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
     250
    237251        # Interswitch amount is not part of the xml data
    238252        xmltext = """<payment_item_detail>
     
    259273    site_name = SITE_NAME
    260274    currency = CURRENCY
    261     pay_item_id = '8303'
     275    pay_item_id = ''
    262276    product_id = PRODUCT_ID
    263277
Note: See TracChangeset for help on using the changeset viewer.