Ignore:
Timestamp:
23 Apr 2012, 14:06:39 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement acceptance fee payments via Interswitch (part 2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py

    r8254 r8259  
    1919"""
    2020import grok
     21from zope.component import getUtility
     22from zope.i18n import translate
    2123from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
     24from waeup.kofa.students.interfaces import IStudentsUtils
    2225from waeup.kofa.applicants.interfaces import (
    2326    IApplicantRegisterUpdate, IApplicant, IApplicantEdit)
     
    2730    ApplicantRegistrationPage, ApplicantAddFormPage,
    2831    OnlinePaymentDisplayFormPage, AcceptanceFeePaymentAddPage,
    29     OnlinePaymentBreadcrumb)
    30 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton
     32    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage,
     33    ApplicantBaseDisplayFormPage)
     34from waeup.kofa.applicants.viewlets import (
     35    RequestCallbackActionButton, PaymentReceiptActionButton)
    3136from waeup.kofa.applicants.pdf import PDFApplicationSlip
    3237from waeup.uniben.applicants.interfaces import (
     
    3641
    3742#class RequestCallbackActionButton(RequestCallbackActionButton):
    38 #    """ Do not display the base package callback button in custom pages.
     43#    """ Display the base package callback button in custom pages.
    3944#    """
    40 #    @property
    41 #    def target_url(self):
    42 #        return ''
     45#    grok.context(ICustomApplicantOnlinePayment)
    4346
    4447#class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage):
    45 #    """ Neutralize callback simulation view
     48#    """ Activate callback simulation view
    4649#    """
    47 #    def update(self):
    48 #        return
     50#    grok.context(ICustomApplicantOnlinePayment)
    4951
    5052class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
    5153    """A breadcrumb for payments.
    5254    """
     55    grok.context(ICustomApplicantOnlinePayment)
     56
     57class PaymentReceiptActionButton(PaymentReceiptActionButton):
     58    grok.order(4)
    5359    grok.context(ICustomApplicantOnlinePayment)
    5460
     
    144150        payment.surcharge_3 = session_config.surcharge_3
    145151        return payment
     152
     153class 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 />
     168The tranzaction code for eTranzact payments is <strong>${a}</strong>.""",
     169            mapping = {'a':tcode}))
     170        return note
Note: See TracChangeset for help on using the changeset viewer.