Ignore:
Timestamp:
5 Oct 2017, 07:15:22 (7 years ago)
Author:
Henrik Bettermann
Message:

Implement special (supplementary) payment application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py

    r14819 r14859  
    4848httplib.HTTPSConnection.debuglevel = 0
    4949HTTPS = True
     50
     51SPECIAL_PAYMENT_PARAMS = {
     52    'certificate': ('111', 500.0, '1012808851', '117'),
     53    'state_result': ('112', 500.0, '1012808851', '117'),
     54    'transcript_local': ('113', 500.0, '1012808851', '117'),
     55    'transcript_foreign': ('114', 500.0, '1012808851', '117'),
     56    'ver_result': ('115', 500.0, '1012808851', '117'),
     57    'change_course': ('116', 500.0, '1012808851', '117'),
     58    'change_inst': ('117', 500.0, '1012808851', '117'),
     59    'jamb_reject': ('118', 500.0, '1012808851', '117'),
     60    'cert_of_cert': ('119', 500.0, '1012808851', '117'),
     61    'ref_let': ('120', 500.0, '1012808851', '117'),
     62    'proc_cert': ('121', 500.0, '1012808851', '117'),
     63    'loss_idcard': ('122', 9.0, '1012808851', '117'),
     64    'loss_examcard': ('123', 4.5, '1012808851', '117'),
     65    'loss_result': ('124', 500.0, '1012808851', '117'),
     66    'loss_receipt': ('125', 500.0, '1012808851', '117'),
     67    'loss_clearance': ('126', 500.0, '1012808851', '117'),
     68    'conv_brochure': ('127', 500.0, '1012808851', '117'),
     69    'hnd_certificate': ('128', 500.0, '1012808851', '117'),
     70    'hnd_state_result': ('129', 500.0, '1012808851', '117'),
     71    'hnd_transcript_local': ('130', 500.0, '1012808851', '117'),
     72    'hnd_transcript_foreign': ('131', 500.0, '1012808851', '117'),
     73    'staff_loss_idcard': ('132', 9.0, '1012808851', '117'),
     74    'hnd_conv_brochure': ('133', 500.0, '1012808851', '117'),
     75    'pgd_state_result': ('134', 500.0, '1012808851', '117'),
     76    'pgd_conv_brochure': ('135', 500.0, '1012808851', '117'),
     77    'pgd_certificate': ('136', 500.0, '1012808851', '117'),
     78    'log_book': ('137', 4.5, '1012808851', '117'),
     79    'pgd_transcript_foreign': ('138', 500.0, '1012808851', '117'),
     80    'pgd_transcript_local': ('139', 500.0, '1012808851', '117'),
     81    'jamb_regularization': ('140', 500.0, '1012808851', '117'),
     82    'utme_registration': ('142', 9.0, '1012808851', '117'),
     83    'utme_cbt': ('143', 9.0, '1012808851', '117'),
     84    'nysc_id_card': ('144', 9.0, '1012808851', '117'),
     85    'ijmb_result': ('147', 500.0, '1012808851', '117'),
     86    }
    5087
    5188class CustomInterswitchPageStudent(InterswitchPageStudent):
     
    132169        xmldict = {}
    133170        provider_amt = 500.0
     171        gateway_amt = GATEWAY_AMT
    134172        xmldict['institution_acct'] = '00000000'
    135173        xmldict['institution_bank_id'] = '00'
     
    141179            xmldict['institution_acct'] = '1015220292'
    142180            xmldict['institution_bank_id'] = '117'
     181        elif self.applicant.applicant_id.startswith('special'):
     182            if self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys():
     183                self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0]
     184                provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1]
     185                xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2]
     186                xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3]
     187        if self.pay_item_id in ('122', '123', '132', '137', '141',
     188                                '142', '143', '144', '146', '147',):
     189                gateway_amt = round(0.015 * self.context.amount_auth, 2)
    143190        xmldict['detail_ref'] = self.context.p_id
    144191        xmldict['provider_amt'] = 100 * provider_amt
     
    146193        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    147194        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    148         xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT)
     195        xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - gateway_amt)
    149196        xmldict['institution_item_name'] = self.context.category
    150197        xmldict['institution_name'] = INSTITUTION_NAME
Note: See TracChangeset for help on using the changeset viewer.