Ignore:
Timestamp:
13 Dec 2022, 11:40:19 (2 years ago)
Author:
Henrik Bettermann
Message:

Implement Interswitch WebCheckout?.

Location:
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py

    r17201 r17216  
    4343    IApplicantOnlinePayment, IApplicantsUtils)
    4444from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment
    45 from kofacustom.nigeria.applicants.browser import NigeriaExportPDFPaymentSlipPage
     45from kofacustom.nigeria.applicants.browser import (
     46    NigeriaExportPDFPaymentSlipPage, NigeriaOnlinePaymentDisplayFormPage)
    4647from kofacustom.lpng.applicants.interfaces import (
    4748    ICustomApplicant,
     
    7172        if self.context.punit:
    7273            punit = self.context.punit.split('_')
    73             return ' / '.join([STATES[punit[0]],
     74            return ' -> '.join([STATES[punit[0]],
    7475                    LGAS['_'.join(punit[:2])],
    7576                    WARDS['_'.join(punit[:3])] ,
     
    139140                   ]]
    140141        if state == STARTED:
    141             actions = [[_('Save'), _('Save and Make Donation via USSD')],
     142            actions = [[_('Save'),
     143                        _('Save and Make Donation via USSD')],
    142144                [
    143145                 #_('Add online payment ticket'),
     
    214216        return form_fields
    215217
     218class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage):
     219    """ Page to view an online payment ticket
     220    """
     221    form_fields = grok.AutoFields(INigeriaApplicantOnlinePayment).omit('ac',
     222        'provider_amt', 'gateway_amt', 'thirdparty_amt',
     223        'p_item', 'display_item', 'p_session')
     224    form_fields[
     225        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     226    form_fields[
     227        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     228
    216229class CustomExportPDFPaymentSlipPage(NigeriaExportPDFPaymentSlipPage):
    217230    """Deliver a PDF slip of the context.
     
    219232    # use IApplicantOnlinePayment alternativly
    220233    form_fields = grok.AutoFields(INigeriaApplicantOnlinePayment).omit(
    221         'p_item').omit('p_option').omit('p_combi')
     234        'p_item', 'p_option', 'p_combi', 'display_item', 'p_session')
    222235    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    223236    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     
    275288    """
    276289    """
    277     grok.context(ICustomApplicant)
     290    grok.context(ICustomApplicantOnlinePayment)
    278291    grok.require('waeup.handleApplication')
    279292    grok.name('ussdinfo')
    280     label = _('Donate via USSD')
     293    label = _('Pay via USSD')
    281294    grok.template('ussdinfo')
    282295    pnav = 3
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser_templates/applicantdisplaypage.pt

    r17198 r17216  
    5454<br />
    5555
    56 <a tal:attributes="href python:view.url(context, 'ussdinfo')" class="btn-big btn btn-primary">Make Donation via USSD</a>
    57 
    58 <tal:payments condition="view/display_payments">
     56<tal:payments condition="python: view.display_payments and len(context.payments)">
    5957  <h3 i18n:domain="waeup.kofa" i18n:translate="">
    6058      Payment Tickets
     
    6765        <th i18n:translate="">Payment Date</th>
    6866        <th i18n:translate="">Category</th>
    69         <th i18n:translate="">Item</th>
    7067        <th i18n:translate="">State</th>
    7168      </tr>
     
    7875        <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td>
    7976        <td tal:content ="value/category">CATEGORY</td>
    80         <td tal:content ="value/display_item">ITEM</td>
    8177        <td tal:content ="value/p_state_title">STATE</td>
    8278      </tr>
     
    8480  </table>
    8581</tal:payments>
     82
     83<a tal:attributes="href python:view.url(context, 'addbp')" class="btn-big btn btn-primary">Make Donation</a>
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser_templates/ussdinfo.pt

    r17190 r17216  
    22
    33<ol>
    4 <li>Pay by USSD Ecobank Customers: <strong>*326*6*Amount*20341823#</strong></li>
    5 <li>Pay by USSD Other Bank Customers: <strong>*BankUSSDcode*000*20341823+Amount#</strong></li>
     4<li>Pay by USSD Ecobank Customers: <strong>*326*6*<span tal:replace="python: int(context.amount_auth)">AMOUNT</span>*20341823#</strong></li>
     5<li>Pay by USSD Other Bank Customers: <strong>*BankUSSDcode*000*20341823+<span tal:replace="python: int(context.amount_auth)">AMOUNT</span>#</strong></li>
    66<li>You can also write your cheque in favour of <strong>BIG TENT FOUNDATION FOR CHARITY, ENLIGHTENMENT AND EMPOWERMENT</strong></li>
    77</ol>
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/viewlets.py

    r17190 r17216  
    2020from waeup.kofa.browser.viewlets import ManageActionButton
    2121from waeup.kofa.applicants.viewlets import ApplicantsAuthTab
    22 from kofacustom.lpng.applicants.interfaces import ICustomApplicant
     22from waeup.kofa.applicants.browser import OnlinePaymentDisplayFormPage
     23from kofacustom.lpng.applicants.interfaces import (
     24    ICustomApplicant, ICustomApplicantOnlinePayment)
    2325from kofacustom.lpng.applicants.browser import (ApplicantDisplayFormPage,
    2426    ApplicantEditFormPage)
     
    5557    grok.view(ApplicantDisplayFormPage)
    5658    icon = 'actionicon_donate.png'
    57     text = _('Make Donation via USSD')
    58     target ='ussdinfo'
     59    text = _('Make Donation')
     60    target ='addbp'
    5961
    6062class MakeUSSDDonationActionButton2(MakeUSSDDonationActionButton):
    6163    grok.view(ApplicantEditFormPage)
     64
     65class MakeUSSDDonationActionButton3(ManageActionButton):
     66    grok.order(1)
     67    grok.context(ICustomApplicantOnlinePayment)
     68    grok.view(OnlinePaymentDisplayFormPage)
     69    grok.require('waeup.payApplicant')
     70    icon = 'actionicon_pay.png'
     71    text = _('Pay via OSSD')
     72    target = 'ussdinfo'
     73
     74    @property
     75    def target_url(self):
     76        if self.context.p_state != 'unpaid':
     77            return ''
     78        if self.context.amount_auth == 0:
     79            return ''
     80        return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.