[10765] | 1 | ## $Id: browser.py 16506 2021-06-15 12:47:06Z henrik $ |
---|
| 2 | ## |
---|
| 3 | ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
| 18 | import httplib |
---|
[12479] | 19 | import hashlib |
---|
[10765] | 20 | import grok |
---|
[16418] | 21 | from waeup.kofa.interfaces import CLEARED, RETURNING |
---|
[10765] | 22 | from kofacustom.nigeria.interswitch.browser import ( |
---|
| 23 | InterswitchPaymentRequestWebservicePageApplicant, |
---|
[11638] | 24 | InterswitchPaymentRequestWebservicePageStudent, |
---|
[13587] | 25 | InterswitchPaymentVerifyWebservicePageApplicant, |
---|
| 26 | InterswitchPaymentVerifyWebservicePageStudent, |
---|
[11638] | 27 | InterswitchPageStudent, InterswitchPageApplicant, |
---|
[10765] | 28 | ) |
---|
[14716] | 29 | from kofacustom.dspg.students.interfaces import ICustomStudentOnlinePayment |
---|
| 30 | from kofacustom.dspg.applicants.interfaces import ICustomApplicantOnlinePayment |
---|
| 31 | from kofacustom.dspg.interfaces import MessageFactory as _ |
---|
[16421] | 32 | from kofacustom.dspg.students.utils import MICROSOFT_FEE |
---|
[10765] | 33 | |
---|
[14726] | 34 | PRODUCT_ID = '7269' # must be provided by Interswitch |
---|
[14749] | 35 | SITE_NAME = 'dspg.waeup.org' |
---|
[14879] | 36 | PROVIDER_ACCT = '2028964403' |
---|
| 37 | PROVIDER_BANK_ID = '8' |
---|
[15248] | 38 | PROVIDER_ITEM_NAME = 'WAEAC' |
---|
[14722] | 39 | INSTITUTION_NAME = 'Delta State Polytechnic Ogwashi-Uku' |
---|
[10765] | 40 | CURRENCY = '566' |
---|
[14727] | 41 | GATEWAY_AMT = 250.0 |
---|
[15021] | 42 | MAC = 'D43ED93B7A307B152C7111D04E1F384428057CD1E75428D3A4C5631C28ACB9C8C822A88CA76DEDC5F9A520CF4BFDB2824FF8B207AAFC667DF3CBB13685B66627' |
---|
[10765] | 43 | |
---|
[14726] | 44 | POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' |
---|
| 45 | #POST_ACTION = 'https://sandbox.interswitchng.com/webpay/pay' |
---|
| 46 | HOST = 'webpay.interswitchng.com' |
---|
| 47 | #HOST = 'sandbox.interswitchng.com' |
---|
| 48 | URL = '/paydirect/api/v1/gettransaction.json' |
---|
| 49 | #URL = '/webpay/api/v1/gettransaction.json' |
---|
[14276] | 50 | |
---|
[12479] | 51 | httplib.HTTPSConnection.debuglevel = 0 |
---|
| 52 | HTTPS = True |
---|
[10765] | 53 | |
---|
[14859] | 54 | SPECIAL_PAYMENT_PARAMS = { |
---|
[14864] | 55 | |
---|
[16411] | 56 | 'carryover1': ('101', 500.0, '1015220292', '117'), |
---|
| 57 | 'carryover4': ('101', 500.0, '1015220292', '117'), |
---|
| 58 | 'carryover5': ('101', 500.0, '1015220292', '117'), |
---|
| 59 | 'carryover6': ('101', 500.0, '1015220292', '117'), |
---|
| 60 | 'carryover7': ('101', 500.0, '1015220292', '117'), |
---|
| 61 | 'carryover8': ('101', 500.0, '1015220292', '117'), |
---|
| 62 | 'carryover9': ('101', 500.0, '1015220292', '117'), |
---|
| 63 | 'carryover10': ('101', 500.0, '1015220292', '117'), |
---|
| 64 | 'carryover11': ('101', 500.0, '1015220292', '117'), |
---|
| 65 | 'carryover12': ('101', 500.0, '1015220292', '117'), |
---|
| 66 | 'balance': ('101', 500.0, '1015220292', '117'), |
---|
[14864] | 67 | |
---|
[15959] | 68 | 'certificate': ('111', 500.0, '1012808851', '117'), |
---|
| 69 | 'state_result': ('112', 500.0, '1012808851', '117'), |
---|
| 70 | 'transcript_local': ('113', 500.0, '1012808851', '117'), |
---|
| 71 | 'transcript_foreign': ('114', 500.0, '1012808851', '117'), |
---|
| 72 | 'ver_result': ('115', 500.0, '1012808851', '117'), |
---|
| 73 | 'change_course': ('116', 500.0, '1012808851', '117'), |
---|
| 74 | 'change_inst': ('117', 500.0, '1012808851', '117'), |
---|
| 75 | 'jamb_reject': ('118', 500.0, '1012808851', '117'), |
---|
| 76 | 'cert_of_cert': ('119', 500.0, '1012808851', '117'), |
---|
| 77 | 'ref_let': ('120', 500.0, '1012808851', '117'), |
---|
| 78 | 'proc_cert': ('121', 500.0, '1012808851', '117'), |
---|
| 79 | 'loss_idcard': ('122', 9.0, '1012808851', '117'), |
---|
| 80 | 'loss_examcard': ('123', 4.5, '1012808851', '117'), |
---|
| 81 | 'loss_result': ('124', 500.0, '1012808851', '117'), |
---|
| 82 | 'loss_receipt': ('125', 500.0, '1012808851', '117'), |
---|
| 83 | 'loss_clearance': ('126', 500.0, '1012808851', '117'), |
---|
| 84 | 'conv_brochure': ('127', 500.0, '1012808851', '117'), |
---|
| 85 | 'hnd_certificate': ('128', 500.0, '1012808851', '117'), |
---|
| 86 | 'hnd_state_result': ('129', 500.0, '1012808851', '117'), |
---|
| 87 | 'hnd_transcript_local': ('130', 500.0, '1012808851', '117'), |
---|
| 88 | 'hnd_transcript_foreign': ('131', 500.0, '1012808851', '117'), |
---|
| 89 | 'staff_loss_idcard': ('132', 9.0, '1012808851', '117'), |
---|
| 90 | 'hnd_conv_brochure': ('133', 500.0, '1012808851', '117'), |
---|
| 91 | 'pgd_state_result': ('134', 500.0, '1012808851', '117'), |
---|
| 92 | 'pgd_conv_brochure': ('135', 500.0, '1012808851', '117'), |
---|
| 93 | 'pgd_certificate': ('136', 500.0, '1012808851', '117'), |
---|
| 94 | 'log_book': ('137', 4.5, '1012808851', '117'), |
---|
| 95 | 'pgd_transcript_foreign': ('138', 500.0, '1012808851', '117'), |
---|
| 96 | 'pgd_transcript_local': ('139', 500.0, '1012808851', '117'), |
---|
| 97 | 'jamb_regularization': ('140', 500.0, '1012808851', '117'), |
---|
| 98 | 'utme_registration': ('142', 9.0, '1012808851', '117'), |
---|
| 99 | 'utme_cbt': ('143', 9.0, '1012808851', '117'), |
---|
| 100 | 'nysc_id_card': ('144', 9.0, '1012808851', '117'), |
---|
| 101 | 'ijmb_result': ('147', 500.0, '1012808851', '117'), |
---|
| 102 | 'conv': ('151', 500.0, '1012808851', '117'), |
---|
[14859] | 103 | } |
---|
| 104 | |
---|
[14862] | 105 | |
---|
[14875] | 106 | # Not yet readily configured. Bank account numbers are |
---|
[14862] | 107 | # contradictory. pay_item_ids are not yet assigned. |
---|
| 108 | |
---|
[11638] | 109 | class CustomInterswitchPageStudent(InterswitchPageStudent): |
---|
[10765] | 110 | """ View which sends a POST request to the Interswitch |
---|
| 111 | CollegePAY payment gateway. |
---|
| 112 | """ |
---|
| 113 | grok.context(ICustomStudentOnlinePayment) |
---|
| 114 | action = POST_ACTION |
---|
| 115 | site_name = SITE_NAME |
---|
| 116 | currency = CURRENCY |
---|
| 117 | product_id = PRODUCT_ID |
---|
[15021] | 118 | mac = MAC |
---|
[14875] | 119 | pay_item_id = '000' |
---|
[10765] | 120 | |
---|
| 121 | def update(self): |
---|
[12979] | 122 | error = self.init_update() |
---|
| 123 | if error: |
---|
| 124 | self.flash(error, type='danger') |
---|
| 125 | self.redirect(self.url(self.context, '@@index')) |
---|
| 126 | return |
---|
[15764] | 127 | self.context.r_company = u'interswitch' |
---|
[11647] | 128 | student = self.student |
---|
| 129 | xmldict = self.xmldict |
---|
[10765] | 130 | # Provider data |
---|
| 131 | xmldict['detail_ref'] = self.context.p_id |
---|
| 132 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
| 133 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
| 134 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
| 135 | # Institution data |
---|
[14875] | 136 | xmldict['institution_acct'] = '00000000' |
---|
| 137 | xmldict['institution_bank_id'] = '00' |
---|
[10765] | 138 | xmldict['institution_amt'] = '0.0' |
---|
[14875] | 139 | provider_amt = 0.0 |
---|
[14961] | 140 | tech_fee = 0.0 |
---|
[16418] | 141 | microsoft_fee = 0.0 |
---|
[14862] | 142 | if self.context.p_category.startswith('schoolfee'): |
---|
| 143 | self.pay_item_id = '102' |
---|
[15764] | 144 | if self.context.p_item != 'Balance': |
---|
| 145 | provider_amt = 2800.0 |
---|
[15767] | 146 | tech_fee = 1200.0 |
---|
[16418] | 147 | if student.state == RETURNING: |
---|
[16421] | 148 | microsoft_fee = MICROSOFT_FEE |
---|
[14889] | 149 | if student.faccode == 'SPAT': |
---|
[16506] | 150 | xmldict['institution_acct'] = '1556004203' |
---|
| 151 | xmldict['institution_bank_id'] = '388' |
---|
[14889] | 152 | elif student.current_mode in ('nd_ft', 'hnd_ft'): |
---|
[16356] | 153 | xmldict['institution_acct'] = '2004145840' |
---|
| 154 | xmldict['institution_bank_id'] = '8' |
---|
[14862] | 155 | elif self.context.p_category == 'clearance': |
---|
| 156 | self.pay_item_id = '103' |
---|
[15764] | 157 | if self.context.p_item != 'Balance': |
---|
| 158 | provider_amt = 500.0 |
---|
[14889] | 159 | if student.faccode == 'SPAT': |
---|
[15227] | 160 | xmldict['institution_acct'] = '1015220292' |
---|
[14875] | 161 | xmldict['institution_bank_id'] = '117' |
---|
[15179] | 162 | elif student.current_mode in ('nd_ft', 'hnd_ft'): |
---|
[15608] | 163 | xmldict['institution_acct'] = '0072223654' |
---|
| 164 | xmldict['institution_bank_id'] = '121' |
---|
[14942] | 165 | elif self.context.p_category == 'gown': |
---|
| 166 | self.pay_item_id = '102' # We use school fee item id. |
---|
| 167 | xmldict['institution_acct'] = '2006612782' |
---|
| 168 | xmldict['institution_bank_id'] = '8' |
---|
[15021] | 169 | elif self.context.p_category == 'sports': |
---|
| 170 | self.pay_item_id = '110' |
---|
| 171 | xmldict['institution_acct'] = '6060300688' |
---|
| 172 | xmldict['institution_bank_id'] = '51' |
---|
| 173 | elif self.context.p_category == 'siwes': |
---|
| 174 | self.pay_item_id = '111' |
---|
[15466] | 175 | xmldict['institution_acct'] = '0080527351' |
---|
| 176 | xmldict['institution_bank_id'] = '11' |
---|
[15022] | 177 | elif self.context.p_category == 'eed_1': |
---|
[15021] | 178 | self.pay_item_id = '112' |
---|
| 179 | xmldict['institution_acct'] = '0039782431' |
---|
| 180 | xmldict['institution_bank_id'] = '11' |
---|
[15022] | 181 | elif self.context.p_category == 'eed_2': |
---|
| 182 | self.pay_item_id = '116' |
---|
| 183 | xmldict['institution_acct'] = '0039782431' |
---|
| 184 | xmldict['institution_bank_id'] = '11' |
---|
[16323] | 185 | elif self.context.p_category == 'eed_extra': |
---|
[16335] | 186 | self.pay_item_id = '157' |
---|
[16323] | 187 | xmldict['institution_acct'] = '0039782431' |
---|
| 188 | xmldict['institution_bank_id'] = '11' |
---|
[15022] | 189 | elif self.context.p_category == 'olevel_results_1': |
---|
[15021] | 190 | self.pay_item_id = '113' |
---|
| 191 | xmldict['institution_acct'] = '2015327204' |
---|
| 192 | xmldict['institution_bank_id'] = '8' |
---|
[15022] | 193 | elif self.context.p_category == 'olevel_results_2': |
---|
| 194 | self.pay_item_id = '115' |
---|
| 195 | xmldict['institution_acct'] = '2015327204' |
---|
| 196 | xmldict['institution_bank_id'] = '8' |
---|
[16309] | 197 | elif self.context.p_category == 'gns_1': |
---|
| 198 | self.pay_item_id = '154' |
---|
| 199 | xmldict['institution_acct'] = '2017447652' |
---|
| 200 | xmldict['institution_bank_id'] = '8' |
---|
| 201 | elif self.context.p_category == 'gns_2': |
---|
| 202 | self.pay_item_id = '155' |
---|
| 203 | xmldict['institution_acct'] = '2017447652' |
---|
| 204 | xmldict['institution_bank_id'] = '8' |
---|
[15219] | 205 | elif self.context.p_category == 'hostel_maintenance': |
---|
[15764] | 206 | if self.context.p_item != 'Balance': |
---|
| 207 | provider_amt = 500.0 |
---|
[15219] | 208 | self.pay_item_id = '117' |
---|
[16384] | 209 | xmldict['institution_acct'] = '1012808851' |
---|
| 210 | xmldict['institution_bank_id'] = '117' |
---|
[15350] | 211 | elif self.context.p_category == 'lsfp_penalty': |
---|
| 212 | self.pay_item_id = '102' |
---|
[15959] | 213 | xmldict['institution_acct'] = '1012808851' |
---|
[15350] | 214 | xmldict['institution_bank_id'] = '117' |
---|
[16323] | 215 | elif self.context.p_category == 'eng_1': |
---|
| 216 | self.pay_item_id = '118' |
---|
| 217 | xmldict['institution_acct'] = '2024473077' |
---|
| 218 | xmldict['institution_bank_id'] = '8' |
---|
| 219 | elif self.context.p_category == 'eng_2': |
---|
| 220 | self.pay_item_id = '119' |
---|
| 221 | xmldict['institution_acct'] = '2024473077' |
---|
| 222 | xmldict['institution_bank_id'] = '8' |
---|
| 223 | elif self.context.p_category == 'bfn': |
---|
| 224 | self.pay_item_id = '125' |
---|
| 225 | xmldict['institution_acct'] = '0048039049' |
---|
| 226 | xmldict['institution_bank_id'] = '11' |
---|
| 227 | elif self.context.p_category == 'facilities': |
---|
[16336] | 228 | self.pay_item_id = '156' |
---|
[16323] | 229 | xmldict['institution_acct'] = '1012808851' |
---|
| 230 | xmldict['institution_bank_id'] = '117' |
---|
[14862] | 231 | elif self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys(): |
---|
| 232 | self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0] |
---|
| 233 | provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1] |
---|
| 234 | xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2] |
---|
| 235 | xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3] |
---|
[10765] | 236 | xmldict['provider_amt'] = 100 * provider_amt |
---|
[14961] | 237 | xmldict['tech_fee'] = 100 * tech_fee |
---|
[16429] | 238 | xmldict['microsoft_fee'] = 100 * microsoft_fee |
---|
[12511] | 239 | xmldict['institution_item_name'] = self.context.category |
---|
[10765] | 240 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
[14889] | 241 | xmldict['institution_amt'] = institution_amt = 100 * ( |
---|
[16429] | 242 | self.context.amount_auth - provider_amt - tech_fee - microsoft_fee - GATEWAY_AMT) |
---|
[14961] | 243 | |
---|
[10765] | 244 | if provider_amt == 0: |
---|
| 245 | xmltext = """<payment_item_detail> |
---|
| 246 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 247 | <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" /> |
---|
| 248 | </item_details> |
---|
| 249 | </payment_item_detail>""" % xmldict |
---|
[14961] | 250 | elif tech_fee == 0: |
---|
| 251 | xmltext = """<payment_item_detail> |
---|
| 252 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 253 | <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" /> |
---|
| 254 | <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" /> |
---|
| 255 | </item_details> |
---|
| 256 | </payment_item_detail>""" % xmldict |
---|
[16418] | 257 | elif microsoft_fee == 0: |
---|
| 258 | xmltext = """<payment_item_detail> |
---|
| 259 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 260 | <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" /> |
---|
| 261 | <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" /> |
---|
| 262 | <item_detail item_id="3" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" /> |
---|
| 263 | </item_details> |
---|
| 264 | </payment_item_detail>""" % xmldict |
---|
[10765] | 265 | else: |
---|
| 266 | xmltext = """<payment_item_detail> |
---|
| 267 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 268 | <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" /> |
---|
| 269 | <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" /> |
---|
[15323] | 270 | <item_detail item_id="3" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" /> |
---|
[16418] | 271 | <item_detail item_id="4" item_name="Microsoft Academy Fee" item_amt="%(microsoft_fee)d" bank_id="8" acct_num="2011810360" /> |
---|
[10765] | 272 | </item_details> |
---|
| 273 | </payment_item_detail>""" % xmldict |
---|
[14889] | 274 | |
---|
| 275 | # isouaba: All certificates in SPAT are part time thus any payments |
---|
| 276 | # coming from those certificates (Application, Acceptance, school fees |
---|
| 277 | # etc) 40% should be split to keystone account. |
---|
[15311] | 278 | # abraham: Please, kindly exclude the 40% going to Keystone bank for school of part- |
---|
| 279 | # time (SPAT) O'level Results Verification payment. |
---|
| 280 | if student.faccode == 'SPAT' and not self.context.p_category.startswith('olevel_results'): |
---|
[14889] | 281 | xmldict['institution_amt_2'] = 0.4 * institution_amt |
---|
| 282 | xmldict['institution_amt_1'] = 0.6 * institution_amt |
---|
| 283 | if provider_amt == 0: |
---|
| 284 | xmltext = """<payment_item_detail> |
---|
| 285 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 286 | <item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
[15707] | 287 | <item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" /> |
---|
[14889] | 288 | </item_details> |
---|
| 289 | </payment_item_detail>""" % xmldict |
---|
[14964] | 290 | elif tech_fee == 0: |
---|
| 291 | xmltext = """<payment_item_detail> |
---|
| 292 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 293 | <item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
[15707] | 294 | <item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" /> |
---|
[14964] | 295 | <item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
| 296 | </item_details> |
---|
| 297 | </payment_item_detail>""" % xmldict |
---|
[14889] | 298 | else: |
---|
| 299 | xmltext = """<payment_item_detail> |
---|
| 300 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 301 | <item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
[15707] | 302 | <item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" /> |
---|
[14889] | 303 | <item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
[15323] | 304 | <item_detail item_id="4" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" /> |
---|
[14889] | 305 | </item_details> |
---|
| 306 | </payment_item_detail>""" % xmldict |
---|
[15255] | 307 | |
---|
| 308 | |
---|
| 309 | # Some payments are treated completely separately. The following lines |
---|
[14921] | 310 | # override the configuration above. |
---|
[15255] | 311 | |
---|
[14921] | 312 | if self.context.p_category == 'dep_sug': |
---|
| 313 | self.pay_item_id = '102' # We use school fee item id |
---|
| 314 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 315 | # must coincide with the amount_auth configured in students/utils.py |
---|
[14938] | 316 | xmldict['amt1'] = 100 * 1000 |
---|
[14921] | 317 | xmldict['amt2'] = 100 * 500 |
---|
| 318 | xmldict['amt3'] = 100 * 900 |
---|
| 319 | xmldict['amt4'] = 100 * 500 |
---|
[14938] | 320 | |
---|
[14940] | 321 | xmltext = """<payment_item_detail> |
---|
[14921] | 322 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 323 | <item_detail item_id="1" item_name="SUG" item_amt="%(amt1)d" bank_id="11" acct_num="0038079930" /> |
---|
| 324 | <item_detail item_id="2" item_name="Students Welfare" item_amt="%(amt2)d" bank_id="11" acct_num="0037892949" /> |
---|
| 325 | <item_detail item_id="3" item_name="Anti-Cult Book" item_amt="%(amt3)d" bank_id="11" acct_num="0037892949" /> |
---|
[14938] | 326 | <item_detail item_id="4" item_name="NADESSTU" item_amt="%(amt4)d" bank_id="11" acct_num="0036375968" /> |
---|
[14921] | 327 | </item_details> |
---|
| 328 | </payment_item_detail>""" % xmldict |
---|
[14940] | 329 | |
---|
[15255] | 330 | if self.context.p_category == 'sbs_1': |
---|
| 331 | self.pay_item_id = '120' |
---|
| 332 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 333 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 334 | xmldict['amt1'] = 100 * 800 |
---|
| 335 | xmldict['amt2'] = 100 * 1000 |
---|
| 336 | xmldict['amt3'] = 100 * 500 |
---|
| 337 | |
---|
| 338 | xmltext = """<payment_item_detail> |
---|
| 339 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 340 | <item_detail item_id="1" item_name="SBS Dues I" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" /> |
---|
| 341 | <item_detail item_id="2" item_name="Journal fee" item_amt="%(amt2)d" bank_id="11" acct_num="0010772626" /> |
---|
| 342 | <item_detail item_id="3" item_name="ABSOBS" item_amt="%(amt3)d" bank_id="8" acct_num="2008185712" /> |
---|
| 343 | </item_details> |
---|
| 344 | </payment_item_detail>""" % xmldict |
---|
| 345 | |
---|
| 346 | if self.context.p_category == 'sbs_2': |
---|
| 347 | self.pay_item_id = '123' |
---|
| 348 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 349 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 350 | xmldict['amt1'] = 100 * 300 |
---|
| 351 | xmldict['amt2'] = 100 * 500 |
---|
| 352 | xmltext = """<payment_item_detail> |
---|
| 353 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 354 | <item_detail item_id="1" item_name="SBS Dues II" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" /> |
---|
| 355 | <item_detail item_id="2" item_name="ABSOBS" item_amt="%(amt2)d" bank_id="8" acct_num="2008185712" /> |
---|
| 356 | </item_details> |
---|
| 357 | </payment_item_detail>""" % xmldict |
---|
| 358 | |
---|
| 359 | if self.context.p_category == 'mkt': |
---|
| 360 | self.pay_item_id = '127' |
---|
| 361 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 362 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 363 | xmldict['amt1'] = 100 * 500 |
---|
| 364 | xmldict['amt2'] = 100 * 500 |
---|
| 365 | xmltext = """<payment_item_detail> |
---|
| 366 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 367 | <item_detail item_id="1" item_name="MKT Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0048297823" /> |
---|
| 368 | <item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2032309812" /> |
---|
| 369 | </item_details> |
---|
| 370 | </payment_item_detail>""" % xmldict |
---|
| 371 | |
---|
| 372 | if self.context.p_category == 'mcn': |
---|
| 373 | self.pay_item_id = '129' |
---|
| 374 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 375 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 376 | xmldict['amt1'] = 100 * 500 |
---|
| 377 | xmldict['amt2'] = 100 * 500 |
---|
| 378 | xmltext = """<payment_item_detail> |
---|
| 379 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 380 | <item_detail item_id="1" item_name="MCN Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010789213" /> |
---|
| 381 | <item_detail item_id="2" item_name="AMCOS" item_amt="%(amt2)d" bank_id="8" acct_num="3020253234" /> |
---|
| 382 | </item_details> |
---|
| 383 | </payment_item_detail>""" % xmldict |
---|
| 384 | |
---|
| 385 | if self.context.p_category == 'otm': |
---|
| 386 | self.pay_item_id = '131' |
---|
| 387 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 388 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 389 | xmldict['amt1'] = 100 * 500 |
---|
| 390 | xmldict['amt2'] = 100 * 500 |
---|
| 391 | xmltext = """<payment_item_detail> |
---|
| 392 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 393 | <item_detail item_id="1" item_name="OTM Dues" item_amt="%(amt1)d" bank_id="8" acct_num="3068446702" /> |
---|
| 394 | <item_detail item_id="2" item_name="NAOTM" item_amt="%(amt2)d" bank_id="11" acct_num="0036652027" /> |
---|
| 395 | </item_details> |
---|
| 396 | </payment_item_detail>""" % xmldict |
---|
| 397 | |
---|
| 398 | if self.context.p_category == 'acct': |
---|
| 399 | self.pay_item_id = '134' |
---|
| 400 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 401 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 402 | xmldict['amt1'] = 100 * 3000 |
---|
| 403 | xmldict['amt2'] = 100 * 500 |
---|
| 404 | xmldict['amt3'] = 100 * 500 |
---|
| 405 | xmltext = """<payment_item_detail> |
---|
| 406 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 407 | <item_detail item_id="1" item_name="Profession Accreditation" item_amt="%(amt1)d" bank_id="11" acct_num="0040285084" /> |
---|
| 408 | <item_detail item_id="2" item_name="ACCT Dues" item_amt="%(amt2)d" bank_id="11" acct_num="0036184955" /> |
---|
[15298] | 409 | <item_detail item_id="3" item_name="NAPAS" item_amt="%(amt3)d" bank_id="8" acct_num="2008498661" /> |
---|
[15255] | 410 | </item_details> |
---|
| 411 | </payment_item_detail>""" % xmldict |
---|
| 412 | |
---|
| 413 | if self.context.p_category == 'bam': |
---|
| 414 | self.pay_item_id = '136' |
---|
| 415 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 416 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 417 | xmldict['amt1'] = 100 * 500 |
---|
| 418 | xmldict['amt2'] = 100 * 500 |
---|
| 419 | xmltext = """<payment_item_detail> |
---|
| 420 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 421 | <item_detail item_id="1" item_name="BAM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010788058" /> |
---|
| 422 | <item_detail item_id="2" item_name="NABAS" item_amt="%(amt2)d" bank_id="8" acct_num="2006936848" /> |
---|
| 423 | </item_details> |
---|
| 424 | </payment_item_detail>""" % xmldict |
---|
| 425 | |
---|
| 426 | if self.context.p_category == 'pom': |
---|
| 427 | self.pay_item_id = '138' |
---|
| 428 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 429 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 430 | xmldict['amt1'] = 100 * 500 |
---|
| 431 | xmldict['amt2'] = 100 * 500 |
---|
| 432 | xmltext = """<payment_item_detail> |
---|
| 433 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 434 | <item_detail item_id="1" item_name="POM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096851444" /> |
---|
| 435 | <item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" /> |
---|
| 436 | </item_details> |
---|
| 437 | </payment_item_detail>""" % xmldict |
---|
| 438 | |
---|
| 439 | if self.context.p_category == 'hrm': |
---|
| 440 | self.pay_item_id = '140' |
---|
| 441 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 442 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 443 | xmldict['amt1'] = 100 * 500 |
---|
| 444 | xmldict['amt2'] = 100 * 500 |
---|
| 445 | xmltext = """<payment_item_detail> |
---|
| 446 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 447 | <item_detail item_id="1" item_name="HRM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096858546" /> |
---|
| 448 | <item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" /> |
---|
| 449 | </item_details> |
---|
| 450 | </payment_item_detail>""" % xmldict |
---|
| 451 | |
---|
[15603] | 452 | if self.context.p_category == 'ndgrad': |
---|
| 453 | self.pay_item_id = '152' |
---|
[15571] | 454 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 455 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 456 | xmldict['amt1'] = 100 * 3000 |
---|
| 457 | xmldict['amt2'] = 100 * 5000 |
---|
| 458 | xmldict['amt3'] = 100 * 1000 |
---|
| 459 | xmldict['amt4'] = 100 * 3500 |
---|
| 460 | xmltext = """<payment_item_detail> |
---|
| 461 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
[15959] | 462 | <item_detail item_id="1" item_name="Collection of Results" item_amt="%(amt1)d" bank_id="117" acct_num="1012808851" /> |
---|
| 463 | <item_detail item_id="2" item_name="Collection of Certificate" item_amt="%(amt2)d" bank_id="117" acct_num="1012808851" /> |
---|
[15571] | 464 | <item_detail item_id="3" item_name="Alumni" item_amt="%(amt3)d" bank_id="8" acct_num="2011810346" /> |
---|
[15604] | 465 | <item_detail item_id="4" item_name="Convocation" item_amt="%(amt4)d" bank_id="8" acct_num="2006612782" /> |
---|
[15571] | 466 | </item_details> |
---|
| 467 | </payment_item_detail>""" % xmldict |
---|
[15255] | 468 | |
---|
[15603] | 469 | if self.context.p_category == 'hndgrad': |
---|
| 470 | self.pay_item_id = '153' |
---|
[15571] | 471 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 472 | # must coincide with the amount_auth configured in students/utils.py |
---|
[15603] | 473 | xmldict['amt1'] = 100 * 5000 |
---|
[15571] | 474 | xmldict['amt2'] = 100 * 7500 |
---|
| 475 | xmldict['amt3'] = 100 * 1000 |
---|
| 476 | xmldict['amt4'] = 100 * 3500 |
---|
| 477 | xmltext = """<payment_item_detail> |
---|
| 478 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
[15959] | 479 | <item_detail item_id="1" item_name="Collection of Results" item_amt="%(amt1)d" bank_id="117" acct_num="1012808851" /> |
---|
| 480 | <item_detail item_id="2" item_name="Collection of Certificate" item_amt="%(amt2)d" bank_id="117" acct_num="1012808851" /> |
---|
[15571] | 481 | <item_detail item_id="3" item_name="Alumni" item_amt="%(amt3)d" bank_id="8" acct_num="2011810346" /> |
---|
[15604] | 482 | <item_detail item_id="4" item_name="Convocation" item_amt="%(amt4)d" bank_id="8" acct_num="2006612782" /> |
---|
[15571] | 483 | </item_details> |
---|
| 484 | </payment_item_detail>""" % xmldict |
---|
| 485 | |
---|
[16367] | 486 | if self.context.p_category == 'sas_1': |
---|
| 487 | self.pay_item_id = '158' |
---|
| 488 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 489 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 490 | xmldict['amt1'] = 100 * 500 |
---|
| 491 | xmldict['amt2'] = 100 * 500 |
---|
| 492 | xmldict['amt3'] = 100 * 500 |
---|
| 493 | xmltext = """<payment_item_detail> |
---|
| 494 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 495 | <item_detail item_id="1" item_name="SAS Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0038956822" /> |
---|
| 496 | <item_detail item_id="2" item_name="Handbook Fee" item_amt="%(amt2)d" bank_id="11" acct_num="0010772626" /> |
---|
| 497 | <item_detail item_id="3" item_name="Association Due" item_amt="%(amt3)d" bank_id="8" acct_num="3069091989" /> |
---|
| 498 | </item_details> |
---|
| 499 | </payment_item_detail>""" % xmldict |
---|
| 500 | |
---|
| 501 | if self.context.p_category == 'sas_2': |
---|
| 502 | self.pay_item_id = '159' |
---|
| 503 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 504 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 505 | xmldict['amt1'] = 100 * 500 |
---|
| 506 | xmldict['amt2'] = 100 * 500 |
---|
| 507 | xmltext = """<payment_item_detail> |
---|
| 508 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 509 | <item_detail item_id="1" item_name="SAS Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0038956822" /> |
---|
| 510 | <item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="8" acct_num="3069091989" /> |
---|
| 511 | </item_details> |
---|
| 512 | </payment_item_detail>""" % xmldict |
---|
| 513 | |
---|
| 514 | if self.context.p_category == 'com': |
---|
| 515 | self.pay_item_id = '160' |
---|
| 516 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 517 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 518 | xmldict['amt1'] = 100 * 500 |
---|
| 519 | xmldict['amt2'] = 100 * 500 |
---|
| 520 | xmltext = """<payment_item_detail> |
---|
| 521 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 522 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="11" acct_num="0010787594" /> |
---|
| 523 | <item_detail item_id="2" item_name="NACOS " item_amt="%(amt2)d" bank_id="8" acct_num="3047146881" /> |
---|
| 524 | </item_details> |
---|
| 525 | </payment_item_detail>""" % xmldict |
---|
| 526 | |
---|
| 527 | if self.context.p_category == 'sta': |
---|
| 528 | self.pay_item_id = '161' |
---|
| 529 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 530 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 531 | xmldict['amt1'] = 100 * 500 |
---|
| 532 | xmldict['amt2'] = 100 * 500 |
---|
| 533 | xmltext = """<payment_item_detail> |
---|
| 534 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 535 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="11" acct_num="0048794281" /> |
---|
| 536 | <item_detail item_id="2" item_name="NASS " item_amt="%(amt2)d" bank_id="8" acct_num="203000173" /> |
---|
| 537 | </item_details> |
---|
| 538 | </payment_item_detail>""" % xmldict |
---|
| 539 | |
---|
| 540 | if self.context.p_category == 'slt_1': |
---|
| 541 | self.pay_item_id = '162' |
---|
| 542 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 543 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 544 | xmldict['amt1'] = 100 * 500 |
---|
| 545 | xmldict['amt2'] = 100 * 500 |
---|
| 546 | xmldict['amt3'] = 100 * 3000 |
---|
| 547 | xmldict['amt4'] = 100 * 500 |
---|
| 548 | xmldict['amt5'] = 100 * 3000 |
---|
| 549 | xmldict['amt6'] = 100 * 2000 |
---|
| 550 | xmltext = """<payment_item_detail> |
---|
| 551 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 552 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="8" acct_num="2033492885" /> |
---|
| 553 | <item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="11" acct_num="0115800071" /> |
---|
| 554 | <item_detail item_id="3" item_name="Professional Due" item_amt="%(amt3)d" bank_id="8" acct_num="2033492885" /> |
---|
| 555 | <item_detail item_id="4" item_name="Prospectus" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" /> |
---|
| 556 | <item_detail item_id="5" item_name="Practical Manual" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" /> |
---|
| 557 | <item_detail item_id="6" item_name="Lab. Coat" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" /> |
---|
| 558 | </item_details> |
---|
| 559 | </payment_item_detail>""" % xmldict |
---|
| 560 | |
---|
| 561 | if self.context.p_category == 'slt_2': |
---|
| 562 | self.pay_item_id = '163' |
---|
| 563 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 564 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 565 | xmldict['amt1'] = 100 * 500 |
---|
| 566 | xmldict['amt2'] = 100 * 500 |
---|
| 567 | xmldict['amt3'] = 100 * 3000 |
---|
| 568 | xmltext = """<payment_item_detail> |
---|
| 569 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 570 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="8" acct_num="2033492885" /> |
---|
| 571 | <item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="11" acct_num="0115800071" /> |
---|
| 572 | <item_detail item_id="3" item_name="Practical Manual" item_amt="%(amt3)d" bank_id="8" acct_num="2033492885" /> |
---|
| 573 | </item_details> |
---|
| 574 | </payment_item_detail>""" % xmldict |
---|
| 575 | |
---|
| 576 | if self.context.p_category == 'lis': |
---|
| 577 | self.pay_item_id = '164' |
---|
| 578 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 579 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 580 | xmldict['amt1'] = 100 * 500 |
---|
| 581 | xmldict['amt2'] = 100 * 500 |
---|
| 582 | xmltext = """<payment_item_detail> |
---|
| 583 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 584 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="" acct_num="0068264131" /> |
---|
| 585 | <item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="" acct_num="" /> |
---|
| 586 | </item_details> |
---|
| 587 | </payment_item_detail>""" % xmldict |
---|
| 588 | |
---|
| 589 | if self.context.p_category == 'htm': |
---|
| 590 | self.pay_item_id = '165' |
---|
| 591 | # amount_auth is being ignored. However, the sum of all split payments |
---|
| 592 | # must coincide with the amount_auth configured in students/utils.py |
---|
| 593 | xmldict['amt1'] = 100 * 500 |
---|
| 594 | xmldict['amt2'] = 100 * 500 |
---|
| 595 | xmltext = """<payment_item_detail> |
---|
| 596 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 597 | <item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="" acct_num="0068264131" /> |
---|
| 598 | <item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="" acct_num="" /> |
---|
| 599 | </item_details> |
---|
| 600 | </payment_item_detail>""" % xmldict |
---|
| 601 | |
---|
| 602 | |
---|
[10765] | 603 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
| 604 | self.context.provider_amt = provider_amt |
---|
| 605 | self.context.gateway_amt = GATEWAY_AMT |
---|
[15765] | 606 | self.amount_auth = int(100 * self.context.amount_auth) |
---|
[12479] | 607 | hashargs = ( |
---|
| 608 | self.context.p_id + |
---|
| 609 | PRODUCT_ID + |
---|
| 610 | self.pay_item_id + |
---|
| 611 | str(int(self.amount_auth)) + |
---|
| 612 | self.site_redirect_url + |
---|
| 613 | self.mac) |
---|
| 614 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
[10765] | 615 | return |
---|
| 616 | |
---|
[11638] | 617 | class CustomInterswitchPageApplicant(InterswitchPageApplicant): |
---|
[10765] | 618 | """ View which sends a POST request to the Interswitch |
---|
| 619 | CollegePAY payment gateway. |
---|
| 620 | """ |
---|
| 621 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 622 | action = POST_ACTION |
---|
| 623 | site_name = SITE_NAME |
---|
| 624 | currency = CURRENCY |
---|
[14729] | 625 | pay_item_id = '101' # must be provided by Interswitch |
---|
[10765] | 626 | product_id = PRODUCT_ID |
---|
[15021] | 627 | mac = MAC |
---|
[10765] | 628 | |
---|
| 629 | def update(self): |
---|
[12979] | 630 | error = self.init_update() |
---|
| 631 | if error: |
---|
| 632 | self.flash(error, type='danger') |
---|
| 633 | self.redirect(self.url(self.context, '@@index')) |
---|
| 634 | return |
---|
[15764] | 635 | self.context.r_company = u'interswitch' |
---|
[10765] | 636 | xmldict = {} |
---|
[14731] | 637 | provider_amt = 500.0 |
---|
[14859] | 638 | gateway_amt = GATEWAY_AMT |
---|
[15075] | 639 | xmldict['institution_acct'] = '00000000' |
---|
| 640 | xmldict['institution_bank_id'] = '00' |
---|
| 641 | if self.applicant.__parent__.application_category in ('ndft', 'hndft'): |
---|
[15474] | 642 | xmldict['institution_acct'] = '0072223654' |
---|
| 643 | xmldict['institution_bank_id'] = '121' |
---|
[15075] | 644 | elif self.applicant.__parent__.application_category in ( |
---|
| 645 | 'ndpt', 'hndpt', 'ndwe', 'hndwe'): |
---|
[15098] | 646 | xmldict['institution_acct'] = '1015220292' |
---|
| 647 | xmldict['institution_bank_id'] = '117' |
---|
[16026] | 648 | elif self.applicant.__parent__.prefix in ('conv', 'hndfincl', 'ndfincl'): |
---|
[15959] | 649 | xmldict['institution_acct'] = '1012808851' |
---|
[15577] | 650 | xmldict['institution_bank_id'] = '117' |
---|
| 651 | self.pay_item_id = '151' |
---|
[15075] | 652 | elif self.applicant.applicant_id.startswith('special'): |
---|
[14859] | 653 | if self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys(): |
---|
| 654 | self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0] |
---|
| 655 | provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1] |
---|
| 656 | xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2] |
---|
| 657 | xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3] |
---|
| 658 | if self.pay_item_id in ('122', '123', '132', '137', '141', |
---|
| 659 | '142', '143', '144', '146', '147',): |
---|
| 660 | gateway_amt = round(0.015 * self.context.amount_auth, 2) |
---|
[10765] | 661 | xmldict['detail_ref'] = self.context.p_id |
---|
| 662 | xmldict['provider_amt'] = 100 * provider_amt |
---|
| 663 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
| 664 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
| 665 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
[14889] | 666 | xmldict['institution_amt'] = institution_amt = 100 * ( |
---|
| 667 | self.context.amount_auth - provider_amt - gateway_amt) |
---|
[12511] | 668 | xmldict['institution_item_name'] = self.context.category |
---|
[10765] | 669 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
| 670 | xmltext = """<payment_item_detail> |
---|
| 671 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 672 | <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" /> |
---|
| 673 | <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" /> |
---|
| 674 | </item_details> |
---|
| 675 | </payment_item_detail>""" % xmldict |
---|
[14889] | 676 | |
---|
| 677 | # isouaba: All certificates in SPAT are part time thus any payments |
---|
| 678 | # coming from those certificates (Application, Acceptance, school fees |
---|
| 679 | # etc) 40% should be split to keystone account. |
---|
| 680 | if self.applicant.__parent__.application_category in ( |
---|
| 681 | 'ndpt', 'hndpt', 'ndwe', 'hndwe'): |
---|
| 682 | xmldict['institution_amt_2'] = 0.4 * institution_amt |
---|
| 683 | xmldict['institution_amt_1'] = 0.6 * institution_amt |
---|
| 684 | xmltext = """<payment_item_detail> |
---|
| 685 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 686 | <item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
[15707] | 687 | <item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" /> |
---|
[14889] | 688 | <item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
| 689 | </item_details> |
---|
| 690 | </payment_item_detail>""" % xmldict |
---|
| 691 | |
---|
[10765] | 692 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
| 693 | self.context.provider_amt = provider_amt |
---|
| 694 | self.context.gateway_amt = GATEWAY_AMT |
---|
[15765] | 695 | self.amount_auth = int(100 * self.context.amount_auth) |
---|
[12479] | 696 | hashargs = ( |
---|
| 697 | self.context.p_id + |
---|
| 698 | PRODUCT_ID + |
---|
| 699 | self.pay_item_id + |
---|
| 700 | str(int(self.amount_auth)) + |
---|
| 701 | self.site_redirect_url + |
---|
| 702 | self.mac) |
---|
| 703 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
[10765] | 704 | return |
---|
| 705 | |
---|
[11638] | 706 | class CustomInterswitchPaymentRequestWebservicePageStudent( |
---|
[10765] | 707 | InterswitchPaymentRequestWebservicePageStudent): |
---|
[13587] | 708 | """Request webservice view for the CollegePAY gateway |
---|
[10765] | 709 | """ |
---|
| 710 | grok.context(ICustomStudentOnlinePayment) |
---|
| 711 | product_id = PRODUCT_ID |
---|
| 712 | gateway_host = HOST |
---|
| 713 | gateway_url = URL |
---|
[15021] | 714 | mac = MAC |
---|
[10765] | 715 | |
---|
[13587] | 716 | class CustomInterswitchPaymentVerifyWebservicePageStudent( |
---|
| 717 | InterswitchPaymentVerifyWebservicePageStudent): |
---|
| 718 | """Payment verify view for the CollegePAY gateway |
---|
| 719 | """ |
---|
| 720 | grok.context(ICustomStudentOnlinePayment) |
---|
| 721 | product_id = PRODUCT_ID |
---|
| 722 | gateway_host = HOST |
---|
| 723 | gateway_url = URL |
---|
[15021] | 724 | mac = MAC |
---|
[13587] | 725 | |
---|
[11638] | 726 | class CustomInterswitchPaymentRequestWebservicePageApplicant( |
---|
[10765] | 727 | InterswitchPaymentRequestWebservicePageApplicant): |
---|
[13587] | 728 | """Request webservice view for the CollegePAY gateway |
---|
[10765] | 729 | """ |
---|
| 730 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 731 | product_id = PRODUCT_ID |
---|
| 732 | gateway_host = HOST |
---|
[12479] | 733 | gateway_url = URL |
---|
[15021] | 734 | mac = MAC |
---|
[13587] | 735 | |
---|
| 736 | class CustomInterswitchPaymentVerifyWebservicePageApplicant( |
---|
| 737 | InterswitchPaymentVerifyWebservicePageApplicant): |
---|
| 738 | """Payment verify view for the CollegePAY gateway |
---|
| 739 | """ |
---|
| 740 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 741 | product_id = PRODUCT_ID |
---|
| 742 | gateway_host = HOST |
---|
[14722] | 743 | gateway_url = URL |
---|
[15021] | 744 | mac = MAC |
---|