Ignore:
Timestamp:
11 Jan 2016, 08:58:32 (9 years ago)
Author:
Henrik Bettermann
Message:

Add Interswitch verification components.

File:
1 edited

Legend:

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

    r13572 r13586  
    2525    InterswitchPaymentRequestWebservicePageStudent,
    2626    InterswitchPaymentRequestWebservicePageApplicant,
     27    InterswitchPaymentVerifyWebservicePageApplicant,
     28    InterswitchPaymentVerifyWebservicePageStudent,
    2729    InterswitchPageStudent, InterswitchPageApplicant,
    2830    )
     
    4345
    4446HOST = 'webpay.interswitchng.com'
     47URL = '/paydirect/api/v1/gettransaction.json'
    4548HTTPS = True
     49MAC = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
    4650
    4751httplib.HTTPSConnection.debuglevel = 0
     
    7377    site_name = SITE_NAME
    7478    currency = CURRENCY
    75     #mac = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
    76     mac = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     79    mac = MAC
    7780
    7881    def update(self):
     
    133136    currency = CURRENCY
    134137    #pay_item_id = '101'
    135     #mac = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
    136     mac = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     138    mac = MAC
    137139
    138140    def update(self):
     
    412414class CustomInterswitchPaymentRequestWebservicePageApplicant(
    413415    InterswitchPaymentRequestWebservicePageApplicant):
    414     """ Request webservice view for the CollegePAY gateway
    415 
    416     So far only PT application has been configured.
     416    """Request webservice view for the CollegePAY gateway
    417417    """
    418418    grok.context(ICustomApplicantOnlinePayment)
    419419    gateway_host = HOST
    420     gateway_url = '/paydirect/api/v1/gettransaction.json'
     420    gateway_url = URL
    421421    https = HTTPS
    422     #mac = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
    423     mac = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     422    mac = MAC
    424423
    425424    @property
     
    429428        return PRODUCT_ID_REGULAR
    430429
     430class CustomInterswitchPaymentVerifyWebservicePageApplicant(
     431    InterswitchPaymentVerifyWebservicePageApplicant):
     432    """Payment verify view for the CollegePAY gateway
     433    """
     434    grok.context(ICustomApplicantOnlinePayment)
     435    gateway_host = HOST
     436    gateway_url = URL
     437    https = HTTPS
     438    mac = MAC
     439
     440    @property
     441    def product_id(self):
     442        if contr_agreement_applicant(self.context.__parent__) == 'first':
     443            return PRODUCT_ID_PT
     444        return PRODUCT_ID_REGULAR
     445
    431446class CustomInterswitchPaymentRequestWebservicePageStudent(
    432447    InterswitchPaymentRequestWebservicePageStudent):
    433     """ Request webservice view for the CollegePAY gateway
     448    """Request webservice view for the CollegePAY gateway
    434449    """
    435450    grok.context(ICustomStudentOnlinePayment)
    436451    gateway_host = HOST
    437     gateway_url = '/paydirect/api/v1/gettransaction.json'
     452    gateway_url = URL
    438453    https = HTTPS
    439     mac = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
     454    mac = MAC
    440455
    441456    @property
     
    444459            return PRODUCT_ID_PT
    445460        return PRODUCT_ID_REGULAR
     461
     462class CustomInterswitchPaymentVerifyWebservicePageStudent(
     463    InterswitchPaymentVerifyWebservicePageStudent):
     464    """Payment verify view for the CollegePAY gateway
     465    """
     466    grok.context(ICustomStudentOnlinePayment)
     467    gateway_host = HOST
     468    gateway_url = URL
     469    https = HTTPS
     470    mac = MAC
     471
     472    @property
     473    def product_id(self):
     474        if contr_agreement_student(self.context.student) == 'first':
     475            return PRODUCT_ID_PT
     476        return PRODUCT_ID_REGULAR
Note: See TracChangeset for help on using the changeset viewer.