Changeset 12479


Ignore:
Timestamp:
16 Jan 2015, 05:52:04 (10 years ago)
Author:
Henrik Bettermann
Message:

Forward hash value to Interswitch payment gateway.

Location:
main/kofacustom.skeleton/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.skeleton/trunk/CHANGES.txt

    r11941 r12479  
    22*******
    33
    4 1.2dev (unreleased)
    5 ===================
     41.2.dev0 (unreleased)
     5=====================
     6
     7* Forward hash value to Interswitch payment gateway.
    68
    79* Create sample application_slip.pdf during tests.
  • main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/browser.py

    r11647 r12479  
    1717##
    1818import httplib
     19import hashlib
    1920import grok
    2021from kofacustom.nigeria.interswitch.browser import (
     
    4445URL = '/paydirect/services/TransactionQueryWs.asmx'
    4546#URL = '/test_paydirect/services/TransactionQueryWs.asmx'
    46 httplib.HTTPConnection.debuglevel = 0
     47httplib.HTTPSConnection.debuglevel = 0
     48HTTPS = True
    4749
    4850class CustomInterswitchPageStudent(InterswitchPageStudent):
     
    5557    currency = CURRENCY
    5658    product_id = PRODUCT_ID
     59    mac = ''
    5760
    5861    def update(self):
     
    97100        self.context.provider_amt = provider_amt
    98101        self.context.gateway_amt = GATEWAY_AMT
     102
     103        hashargs = (
     104            self.context.p_id +
     105            PRODUCT_ID +
     106            self.pay_item_id +
     107            str(int(self.amount_auth)) +
     108            self.site_redirect_url +
     109            self.mac)
     110        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
    99111        return
    100112
     
    109121    pay_item_id = '0000'
    110122    product_id = PRODUCT_ID
     123    mac = ''
    111124
    112125    def update(self):
     
    134147        self.context.provider_amt = provider_amt
    135148        self.context.gateway_amt = GATEWAY_AMT
     149
     150        hashargs = (
     151            self.context.p_id +
     152            PRODUCT_ID +
     153            self.pay_item_id +
     154            str(int(self.amount_auth)) +
     155            self.site_redirect_url +
     156            self.mac)
     157        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
    136158        return
    137159
     
    144166    gateway_host = HOST
    145167    gateway_url = URL
     168    https = HTTPS
    146169
    147170class CustomInterswitchPaymentRequestWebservicePageApplicant(
     
    153176    gateway_host = HOST
    154177    gateway_url = URL
     178    https = HTTPS
  • main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/tests.py

    r11813 r12479  
    7272        self.payment_url = self.browser.url
    7373        self.browser.getLink("CollegePAY", index=0).click()
    74         # The total amount to be processed by Interswitch
    75         # has been reduced by the Interswitch fee of 150 Nairas
    7674        self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
    7775                           self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.