Changeset 14767 for main/waeup.uniben/trunk/src/waeup/uniben/remita
- Timestamp:
- 4 Aug 2017, 06:26:39 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/remita/browser.py
r14760 r14767 17 17 ## 18 18 19 from kofacustom.nigeria.remita. browser import (19 from kofacustom.nigeria.remita.studentsbrowser import ( 20 20 module_activated, 21 21 RemitaRequestPaymentStatusPageStudent, 22 22 RemitaPageStudent) 23 from kofacustom.nigeria.remita.applicantsbrowser import ( 24 RemitaRequestPaymentStatusPageApplicant, 25 RemitaPageApplicant) 23 26 24 27 class CustomRemitaRequestPaymentStatusPageStudent( … … 63 66 return lineitems 64 67 68 def dynamic_provider_amt(self, student): 69 if student.entry_session >= 2016: 70 return 2500.0 71 return 1500.0 72 73 @property 74 def xxx_lineitems(self): 75 provider_amt = 0.0 76 if self.context.p_category == 'schoolfee' and \ 77 not self.context.p_item == 'Balance': 78 provider_amt = self.dynamic_provider_amt(self.student) 79 elif self.context.p_category == 'clearance': 80 provider_amt = self.dynamic_provider_amt(self.student) 81 inst_amt = self.context.amount_auth - provider_amt 82 if provider_amt: 83 lineitems = ( 84 {"lineItemsId":"itemid1","beneficiaryName":"Uniben", 85 "beneficiaryAccount":"2017506430","bankCode":"011", 86 "beneficiaryAmount":inst_amt,"deductFeeFrom":"1"}, 87 {"lineItemsId":"itemid2","beneficiaryName":"WAeAC", 88 "beneficiaryAccount":"1014261520","bankCode":"057", 89 "beneficiaryAmount":provider_amt,"deductFeeFrom":"0"} 90 ) 91 else: 92 lineitems = ( 93 {"lineItemsId":"itemid1","beneficiaryName":"Uniben", 94 "beneficiaryAccount":"2017506430","bankCode":"011", 95 "beneficiaryAmount":inst_amt,"deductFeeFrom":"1"}, 96 ) 97 return lineitems 98 65 99 def update(self): 66 100 if not module_activated(self.context.student.current_session): … … 74 108 return 75 109 return 110 111 class CustomRemitaRequestPaymentStatusPageApplicant( 112 RemitaRequestPaymentStatusPageApplicant): 113 """ Request webservice view for the Remita gateway. 114 """ 115 116 # Here we use Remita test portal data 117 merchantId = '2547916' 118 host = 'www.remitademo.net' 119 https = True 120 api_key = '1946' 121 122 class CustomRemitaPageApplicant(RemitaPageApplicant): 123 """ View which sends a POST request to the Remita payment gateway. 124 """ 125 126 # Here we use Remita test portal data 127 merchantId = '2547916' 128 serviceTypeId = '4430731' 129 api_key = '1946' 130 #orderId = '3456346346' 131 host = 'www.remitademo.net' 132 init_url = '/remita/ecomm/split/init.reg' 133 #amount='1000' 134 https = True 135 136 action = 'http://www.remitademo.net/remita/ecomm/finalize.reg' 137 138 @property 139 def lineitems(self): 140 141 lineitems = ( 142 {"lineItemsId":"itemid1","beneficiaryName":"Klaus Mueller", 143 "beneficiaryAccount":"6020067886","bankCode":"011", 144 "beneficiaryAmount":self.context.amount_auth/2,"deductFeeFrom":"1"}, 145 {"lineItemsId":"itemid2","beneficiaryName":"Werner Rumm", 146 "beneficiaryAccount":"0360883515","bankCode":"050", 147 "beneficiaryAmount":self.context.amount_auth/2,"deductFeeFrom":"0"} 148 ) 149 return lineitems 150 151 def update(self): 152 if not module_activated(self.context.__parent__.__parent__.year): 153 return 154 self.orderId = self.context.p_id 155 self.amount = str(self.context.amount_auth) 156 error = self.init_update() 157 if error: 158 self.flash(error, type='danger') 159 self.redirect(self.url(self.context, '@@index')) 160 return 161 return
Note: See TracChangeset for help on using the changeset viewer.