Changeset 7878 for main/waeup.kofa/trunk
- Timestamp:
- 14 Mar 2012, 09:35:47 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7875 r7878 1109 1109 return 1110 1110 1111 class InterswitchPage(KofaPage):1112 """ View which sends a POST request to the Interswitch1113 CollegePAY payment gateway.1114 """1115 grok.context(IStudentOnlinePayment)1116 grok.name('goto_interswitch')1117 grok.template('goto_interswitch')1118 grok.require('waeup.payStudent')1119 1120 label = _('Submit data to CollegePAY (Interswitch Payment Gateway)')1121 submit_button = _('Submit')1122 1123 # Uniben product data (to be removed later)1124 product_id = '57'1125 currency = '566'1126 pay_item_id = '5700'1127 1128 action = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'1129 site_redirect_url = 'http://localhost?echo='1130 site_name = 'xyz.waeup.org'1131 provider_acct = '2345'1132 provider_bank_id = '8'1133 provider_item_name = 'Kofa Provider Fee'1134 institution_acct = '1234'1135 institution_bank_id = '9'1136 institution_name = 'Sample University'1137 1138 def update(self):1139 if self.context.p_state != 'unpaid':1140 self.flash(_("Payment ticket can't be re-send to CollegePAY."))1141 self.redirect(self.url(self.context, '@@index'))1142 return1143 xmldict = {}1144 self.student = self.context.getStudent()1145 self.amount = (self.context.amount_auth + self.context.surcharge_1 +1146 self.context.surcharge_2 + self.context.surcharge_3)1147 self.local_date_time = str(self.context.creation_date)1148 certificate = getattr(self.student['studycourse'],'certificate',None)1149 if certificate is not None:1150 xmldict['department'] = certificate.__parent__.__parent__.code1151 xmldict['faculty'] = certificate.__parent__.__parent__.__parent__.code1152 else:1153 xmldict['department'] = None1154 xmldict['faculty'] = None1155 xmldict['detail_ref'] = self.context.p_id1156 xmldict['provider_amt'] = self.context.surcharge_11157 xmldict['provider_acct'] = self.provider_acct1158 xmldict['provider_bank_id'] = self.provider_bank_id1159 xmldict['provider_item_name'] = self.provider_item_name1160 xmldict['institution_amt'] = self.amount1161 xmldict['institution_acct'] = self.institution_acct1162 xmldict['institution_bank_id'] = self.institution_bank_id1163 xmldict['institution_item_name'] = self.context.p_category1164 xmldict['institution_name'] = self.institution_name1165 xmltext = """<payment_item_detail>1166 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">1167 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />1168 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />1169 </item_details>1170 </payment_item_detail>""" % xmldict1171 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext1172 return1173 1174 1111 class ExportPDFPaymentSlipPage(UtilityView, grok.View): 1175 1112 """Deliver a PDF slip of the context. -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r7876 r7878 322 322 return self.view.url(self.view.context, self.target) 323 323 324 class InterswitchActionButton(ManageActionButton):325 grok.order(3)326 grok.context(IStudentOnlinePayment)327 grok.view(OnlinePaymentDisplayFormPage)328 grok.require('waeup.payStudent')329 icon = 'actionicon_pay.png'330 text = _('CollegePAY')331 target = 'goto_interswitch'332 333 @property334 def target_url(self):335 if self.context.p_state != 'unpaid':336 return ''337 return self.view.url(self.view.context, self.target)338 339 324 class AddBedTicketActionButton(ManageActionButton): 340 325 grok.order(1)
Note: See TracChangeset for help on using the changeset viewer.