Changeset 11637 for main/waeup.aaua/trunk/src/waeup/aaua/interswitch
- Timestamp:
- 13 May 2014, 10:37:46 (11 years ago)
- Location:
- main/waeup.aaua/trunk/src/waeup/aaua/interswitch
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaua/trunk/src/waeup/aaua/interswitch/browser.py
r10952 r11637 20 20 import grok 21 21 from zope.interface import Interface 22 from zope.component import getUtility,queryAdapter22 from zope.component import queryAdapter 23 23 from kofacustom.nigeria.interswitch.browser import ( 24 InterswitchPaymentRequestWebservicePageStudent 24 InterswitchPaymentRequestWebservicePageStudent, 25 InterswitchPageStudent 25 26 ) 26 from waeup.kofa.browser.layout import KofaPage, UtilityView27 from waeup.kofa.interfaces import IKofaUtils28 from waeup.kofa.utils.helpers import to_timezone29 27 from waeup.aaua.students.interfaces import ICustomStudentOnlinePayment 30 28 from waeup.aaua.applicants.interfaces import ICustomApplicantOnlinePayment … … 60 58 return static['interswitch_verve_mastercard.gif']() 61 59 62 class InterswitchPageStudent(KofaPage):60 class CustomInterswitchPageStudent(InterswitchPageStudent): 63 61 """ View which sends a POST request to the Interswitch 64 62 CollegePAY payment gateway. 65 63 """ 66 64 grok.context(ICustomStudentOnlinePayment) 67 grok.name('goto_interswitch')68 65 grok.template('student_goto_interswitch') 69 grok.require('waeup.payStudent')70 label = _('Submit data to CollegePAY (Interswitch Payment Gateway)')71 submit_button = _('Submit')72 66 action = POST_ACTION 73 67 site_name = SITE_NAME … … 80 74 81 75 def update(self): 82 #if self.context.p_state != 'unpaid': 83 if self.context.p_state == 'paid': 84 self.flash(_("Payment ticket can't be re-send to CollegePAY.")) 85 self.redirect(self.url(self.context, '@@index')) 86 return 87 88 student = self.student = self.context.student 89 certificate = getattr(student['studycourse'],'certificate',None) 90 self.amount_auth = 100 * self.context.amount_auth 91 xmldict = {} 92 if certificate is not None: 93 xmldict['department'] = certificate.__parent__.__parent__.code 94 xmldict['faculty'] = certificate.__parent__.__parent__.__parent__.code 95 else: 96 xmldict['department'] = None 97 xmldict['faculty'] = None 98 self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category] 99 tz = getUtility(IKofaUtils).tzinfo 100 self.local_date_time = to_timezone( 101 self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z") 102 self.site_redirect_url = self.url(self.context, 'request_webservice') 76 student, certificate, xmldict = super( 77 CustomInterswitchPageStudent, self).update() 103 78 # Provider data 104 79 xmldict['detail_ref'] = self.context.p_id … … 157 132 return 158 133 159 class InterswitchPaymentRequestWebservicePageStudent(134 class CustomInterswitchPaymentRequestWebservicePageStudent( 160 135 InterswitchPaymentRequestWebservicePageStudent): 161 136 """ Request webservice view for the CollegePAY gateway
Note: See TracChangeset for help on using the changeset viewer.