Changeset 8259
- Timestamp:
- 23 Apr 2012, 14:06:39 (13 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8254 r8259 19 19 """ 20 20 import grok 21 from zope.component import getUtility 22 from zope.i18n import translate 21 23 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 24 from waeup.kofa.students.interfaces import IStudentsUtils 22 25 from waeup.kofa.applicants.interfaces import ( 23 26 IApplicantRegisterUpdate, IApplicant, IApplicantEdit) … … 27 30 ApplicantRegistrationPage, ApplicantAddFormPage, 28 31 OnlinePaymentDisplayFormPage, AcceptanceFeePaymentAddPage, 29 OnlinePaymentBreadcrumb) 30 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton 32 OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage, 33 ApplicantBaseDisplayFormPage) 34 from waeup.kofa.applicants.viewlets import ( 35 RequestCallbackActionButton, PaymentReceiptActionButton) 31 36 from waeup.kofa.applicants.pdf import PDFApplicationSlip 32 37 from waeup.uniben.applicants.interfaces import ( … … 36 41 37 42 #class RequestCallbackActionButton(RequestCallbackActionButton): 38 # """ D o not display the base package callback button in custom pages.43 # """ Display the base package callback button in custom pages. 39 44 # """ 40 # @property 41 # def target_url(self): 42 # return '' 45 # grok.context(ICustomApplicantOnlinePayment) 43 46 44 47 #class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage): 45 # """ Neutralize callback simulation view48 # """ Activate callback simulation view 46 49 # """ 47 # def update(self): 48 # return 50 # grok.context(ICustomApplicantOnlinePayment) 49 51 50 52 class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb): 51 53 """A breadcrumb for payments. 52 54 """ 55 grok.context(ICustomApplicantOnlinePayment) 56 57 class PaymentReceiptActionButton(PaymentReceiptActionButton): 58 grok.order(4) 53 59 grok.context(ICustomApplicantOnlinePayment) 54 60 … … 144 150 payment.surcharge_3 = session_config.surcharge_3 145 151 return payment 152 153 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage): 154 """Deliver a PDF slip of the context. 155 """ 156 grok.context(ICustomApplicantOnlinePayment) 157 form_fields = grok.AutoFields(ICustomApplicantOnlinePayment) 158 form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 159 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 160 161 @property 162 def note(self): 163 tcode = self.context.p_id 164 tcode = tcode[len(tcode)-8:len(tcode)] 165 amount = self.context.amount_auth 166 note = translate(_( 167 u"""<br /><br /><br /> 168 The tranzaction code for eTranzact payments is <strong>${a}</strong>.""", 169 mapping = {'a':tcode})) 170 return note -
main/waeup.uniben/trunk/src/waeup/uniben/etranzact/browser.py
r8256 r8259 29 29 from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment 30 30 from waeup.uniben.applicants.interfaces import ICustomApplicantOnlinePayment 31 31 32 32 33 TERMINAL_ID = '0500000003' … … 101 102 class EtranzactEnterPinActionButtonApplicant(RCABApplicant): 102 103 grok.context(ICustomApplicantOnlinePayment) 104 grok.order(3) 103 105 icon = 'actionicon_call.png' 104 106 text = _('Query eTranzact History') … … 107 109 class EtranzactEnterPinActionButtonStudent(RCABStudent): 108 110 grok.context(ICustomStudentOnlinePayment) 111 grok.order(3) 109 112 icon = 'actionicon_call.png' 110 113 text = _('Query eTranzact History') -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r8256 r8259 28 28 from waeup.kofa.students.viewlets import RequestCallbackActionButton as RCABStudent 29 29 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton as RCABApplicant 30 from waeup.kofa.payments.interfaces import payment_categories 30 31 from waeup.uniben.students.utils import actions_after_student_payment 31 32 from waeup.uniben.applicants.utils import actions_after_applicant_payment … … 34 35 # Interswitch test account data: 35 36 # 36 # Card Number: 6274807700000007 37 # Expiry Date: July 2012 38 # PIN: 0000 39 40 # Card Number: 6278050000000007 41 # Expiry Date: July 2012 42 # PIN: 0000 37 # Card Number: 6274807700000007 38 # Expiry Date: July 2012 39 # PIN: 0000 40 41 # Card Number: 6278050000000007 42 # Expiry Date: July 2012 43 # PIN: 0000 44 # 45 # PAN,EXPIRY,PIN,CVV2 46 # 5060990330000003386,1304,0000,543 47 # 5060990330000003394,1304,0000,865 48 # 5060990330000003402,1304,0000,012 49 # 5060990330000003410,1304,0000,737 50 # 5060990330000003428,1304,0000,310 51 # 5060990330000003436,1304,0000,173 43 52 44 53 PRODUCT_ID = '57' … … 160 169 161 170 class InterswitchActionButtonStudent(RCABStudent): 162 grok.order( 2)171 grok.order(1) 163 172 grok.context(ICustomStudentOnlinePayment) 164 173 icon = 'actionicon_pay.png' … … 173 182 174 183 class InterswitchActionButtonApplicant(RCABApplicant): 175 grok.order( 2)184 grok.order(1) 176 185 grok.context(ICustomApplicantOnlinePayment) 177 186 icon = 'actionicon_pay.png' … … 186 195 187 196 # Deprecated 188 class InterswitchRequestCallbackActionButtonStudent(RCABStudent): 189 grok.order(3) 197 #class InterswitchRequestCallbackActionButtonStudent(RCABStudent): 198 # grok.order(3) 199 # grok.context(ICustomStudentOnlinePayment) 200 # icon = 'actionicon_call.png' 201 # text = _('Request CollegePAY callback') 202 203 # def target_url(self): 204 # if self.context.p_state == 'paid': 205 # return '' 206 # site_redirect_url = self.view.url(self.view.context, 'isw_callback') 207 # args = { 208 # 'transRef':self.context.p_id, 209 # 'prodID':PRODUCT_ID, 210 # 'redirectURL':site_redirect_url} 211 # return QUERY_URL + '?%s' % urllib.urlencode(args) 212 213 # Alternative preferred solution 214 class InterswitchRequestWebserviceActionButtonStudent(RCABStudent): 215 grok.order(2) 190 216 grok.context(ICustomStudentOnlinePayment) 191 217 icon = 'actionicon_call.png' 192 text = _('Request CollegePAY callback') 193 194 def target_url(self): 195 if self.context.p_state == 'paid': 196 return '' 197 site_redirect_url = self.view.url(self.view.context, 'isw_callback') 198 args = { 199 'transRef':self.context.p_id, 200 'prodID':PRODUCT_ID, 201 'redirectURL':site_redirect_url} 202 return QUERY_URL + '?%s' % urllib.urlencode(args) 203 204 # Alternative preferred solution 205 class InterswitchRequestWebserviceActionButtonStudent(RCABStudent): 206 grok.order(4) 207 grok.context(ICustomStudentOnlinePayment) 208 icon = 'actionicon_call.png' 209 text = _('Request CollegePAY webservice') 218 text = _('Request CollegePAY Webservice') 210 219 target = 'request_webservice' 211 220 212 221 class InterswitchRequestWebserviceActionButtonApplicant(RCABApplicant): 213 grok.order( 4)222 grok.order(2) 214 223 grok.context(ICustomApplicantOnlinePayment) 215 224 icon = 'actionicon_call.png' 216 text = _('Request CollegePAY webservice')225 text = _('Request CollegePAY Webservice') 217 226 target = 'request_webservice' 218 227 … … 252 261 self.amount = (self.context.amount_auth + self.context.surcharge_1 + 253 262 self.context.surcharge_2 + self.context.surcharge_3) 263 self.category = payment_categories.getTermByToken( 264 self.context.p_category).title 254 265 self.amount_100 = 100 * self.amount 255 266 self.local_date_time = str(self.context.creation_date) … … 267 278 268 279 def update(self): 269 if self.context.p_state != 'unpaid':270 self.flash(_("Payment ticket can't be re-send to CollegePAY."))271 self.redirect(self.url(self.context, '@@index'))272 return280 #if self.context.p_state != 'unpaid': 281 # self.flash(_("Payment ticket can't be re-send to CollegePAY.")) 282 # self.redirect(self.url(self.context, '@@index')) 283 # return 273 284 self.applicant = self.context.__parent__ 274 285 xmldict = {} 275 286 xmldict['department'] = None 276 287 xmldict['faculty'] = None 288 self.category = payment_categories.getTermByToken( 289 self.context.p_category).title 277 290 self.amount = (self.context.amount_auth + self.context.surcharge_1 + 278 291 self.context.surcharge_2 + self.context.surcharge_3) -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/applicant_goto_interswitch.pt
r8256 r8259 50 50 Payment Category:</td> 51 51 <td> 52 <span tal:replace="view/c ontext/p_category">PAYMENTCATEGORY</span>52 <span tal:replace="view/category">PAYMENTCATEGORY</span> 53 53 </td> 54 54 </tr> … … 63 63 <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" /> 64 64 <input type="hidden" name="amount" tal:attributes="value view/amount_100" /> 65 66 65 <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" /> 67 <input type="hidden" name="cust_id_desc" tal:attributes="value view/context/p_item" /> 68 <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_category" /> 69 66 <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_item" /> 67 <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" /> 70 68 <input type="hidden" name="cust_id" tal:attributes="value view/applicant/applicant_id" /> 71 69 <input type="hidden" name="cust_name" tal:attributes="value view/applicant/display_fullname" /> 72 73 70 74 71 <input type="hidden" name="payment_params" value="college_split" /> -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/student_goto_interswitch.pt
r8256 r8259 50 50 Payment Category:</td> 51 51 <td> 52 <span tal:replace="view/c ontext/p_category">PAYMENTCATEGORY</span>52 <span tal:replace="view/category">PAYMENTCATEGORY</span> 53 53 </td> 54 54 </tr> … … 63 63 <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" /> 64 64 <input type="hidden" name="amount" tal:attributes="value view/amount_100" /> 65 66 65 <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" /> 67 <input type="hidden" name="cust_id_desc" tal:attributes="value view/context/p_item" /> 68 <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_category" /> 69 66 <input type="hidden" name="pay_item_name" tal:attributes="value view/context/p_item" /> 67 <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" /> 70 68 <input type="hidden" name="cust_id" tal:attributes="value view/student/student_id" /> 71 69 <input type="hidden" name="cust_name" tal:attributes="value view/student/display_fullname" /> 72 73 70 74 71 <input type="hidden" name="payment_params" value="college_split" /> -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r8247 r8259 19 19 from zope.formlib.textwidgets import BytesDisplayWidget 20 20 from zope.component import getUtility 21 from zope.i18n import translate 21 22 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 22 23 from waeup.kofa.interfaces import IExtFileStore … … 29 30 StudentBaseEditFormPage, StudentPersonalEditFormPage, 30 31 OnlinePaymentDisplayFormPage, OnlinePaymentAddFormPage, 31 OnlinePaymentBreadcrumb) 32 from waeup.kofa.students.viewlets import RequestCallbackActionButton 32 OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage) 33 from waeup.kofa.students.viewlets import ( 34 RequestCallbackActionButton, PaymentReceiptActionButton) 33 35 from waeup.uniben.students.interfaces import ( 34 36 ICustomStudentBase, ICustomStudent, ICustomStudentPersonal, … … 38 40 from waeup.uniben.interfaces import MessageFactory as _ 39 41 42 #class RequestCallbackActionButton(RequestCallbackActionButton): 43 # """ Display the base package callback button in custom pages. 44 # """ 45 # grok.context(ICustomStudentOnlinePayment) 46 47 #class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage): 48 # """ Activate callback simulation view 49 # """ 50 # grok.context(ICustomStudentOnlinePayment) 51 40 52 class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb): 41 53 """A breadcrumb for payments. … … 43 55 grok.context(ICustomStudentOnlinePayment) 44 56 45 class RequestCallbackActionButton(RequestCallbackActionButton): 46 """ Do not display the base package callback button in custom pages. 47 """ 48 @property 49 def target_url(self): 50 return '' 51 52 class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage): 53 """ Neutralize callback simulation view 54 """ 55 def update(self): 56 return 57 class PaymentReceiptActionButton(PaymentReceiptActionButton): 58 grok.order(4) 59 grok.context(ICustomStudentOnlinePayment) 57 60 58 61 class CustomStudentBaseManageFormPage(StudentBaseManageFormPage): … … 182 185 payment.surcharge_3 = pay_details['surcharge_3'] 183 186 return payment 187 188 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage): 189 """Deliver a PDF slip of the context. 190 """ 191 grok.context(ICustomStudentOnlinePayment) 192 form_fields = grok.AutoFields(ICustomStudentOnlinePayment) 193 form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 194 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 195 196 @property 197 def note(self): 198 tcode = self.context.p_id 199 tcode = tcode[len(tcode)-8:len(tcode)] 200 amount = self.context.amount_auth 201 note = translate(_( 202 u"""<br /><br /><br /> 203 The tranzaction code for eTranzact payments is <strong>${a}</strong>.""", 204 mapping = {'a':tcode})) 205 return note
Note: See TracChangeset for help on using the changeset viewer.