Changeset 8421


Ignore:
Timestamp:
11 May 2012, 15:46:29 (12 years ago)
Author:
Henrik Bettermann
Message:

Implement payment approval in waeup.uniben.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
1 deleted
6 edited

Legend:

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

    r8292 r8421  
    2626    IApplicantRegisterUpdate, IApplicant, IApplicantEdit)
    2727from waeup.kofa.applicants.browser import (ApplicantDisplayFormPage,
    28     OnlinePaymentCallbackPage, ExportPDFPage,
     28    ExportPDFPage,
    2929    ApplicantManageFormPage, ApplicantEditFormPage,
    3030    ApplicantRegistrationPage, ApplicantAddFormPage,
     
    3333    ApplicantBaseDisplayFormPage)
    3434from waeup.kofa.applicants.viewlets import (
    35     RequestCallbackActionButton, PaymentReceiptActionButton)
     35    PaymentReceiptActionButton)
    3636from waeup.kofa.applicants.pdf import PDFApplicationSlip
    3737from waeup.uniben.applicants.interfaces import (
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/payment.py

    r8263 r8421  
    2222from zope.component.interfaces import IFactory
    2323from zope.interface import implementedBy
    24 from waeup.kofa.payments import OnlinePayment
     24from waeup.kofa.applicants.payment import ApplicantOnlinePayment
    2525from waeup.kofa.utils.helpers import attrs_to_fields
    2626from waeup.uniben.applicants.interfaces import ICustomApplicantOnlinePayment
    2727
    28 class CustomApplicantOnlinePayment(OnlinePayment):
    29     """This is an online payment.
     28class CustomApplicantOnlinePayment(ApplicantOnlinePayment):
     29    """This is a custom online payment for applicants.
     30
     31    Since this class inherits from ApplicantOnlinePayment, it automatically
     32    implements the interfaces of the parent class which means
     33    all viewlets and views meant for StudentOnlinePayment
     34    can also be accessed in the customized system.
    3035    """
    3136    grok.implements(ICustomApplicantOnlinePayment)
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py

    r8401 r8421  
    2727from waeup.kofa.utils.helpers import to_timezone
    2828from waeup.kofa.students.browser import write_log_message
    29 from waeup.kofa.students.viewlets import RequestCallbackActionButton as RCABStudent
    30 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton as RCABApplicant
     29from waeup.kofa.students.viewlets import ApprovePaymentActionButton as APABStudent
     30from waeup.kofa.applicants.viewlets import ApprovePaymentActionButton as APABApplicant
    3131from waeup.kofa.payments.interfaces import payment_categories
    3232from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment
     
    128128    return True
    129129
    130 class InterswitchActionButtonStudent(RCABStudent):
     130class InterswitchActionButtonStudent(APABStudent):
    131131    grok.order(1)
    132132    grok.context(ICustomStudentOnlinePayment)
     
    141141        return self.view.url(self.view.context, self.target)
    142142
    143 class InterswitchActionButtonApplicant(RCABApplicant):
     143class InterswitchActionButtonApplicant(APABApplicant):
    144144    grok.order(1)
    145145    grok.context(ICustomApplicantOnlinePayment)
     
    172172
    173173# Alternative preferred solution
    174 class InterswitchRequestWebserviceActionButtonStudent(RCABStudent):
     174class InterswitchRequestWebserviceActionButtonStudent(APABStudent):
    175175    grok.order(2)
    176176    grok.context(ICustomStudentOnlinePayment)
    177177    icon = 'actionicon_call.png'
    178     text = _('Request CollegePAY Webservice')
     178    text = _('Requery CollegePAY')
    179179    target = 'request_webservice'
    180180
    181 class InterswitchRequestWebserviceActionButtonApplicant(RCABApplicant):
     181class InterswitchRequestWebserviceActionButtonApplicant(APABApplicant):
    182182    grok.order(2)
    183183    grok.context(ICustomApplicantOnlinePayment)
    184184    icon = 'actionicon_call.png'
    185     text = _('Request CollegePAY Webservice')
     185    text = _('Requery CollegePAY')
    186186    target = 'request_webservice'
    187187
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r8263 r8421  
    2626    StudentPersonalDisplayFormPage,
    2727    StudentClearanceManageFormPage, StudentClearanceEditFormPage,
    28     StudentClearanceDisplayFormPage, OnlinePaymentCallbackPage,
     28    StudentClearanceDisplayFormPage, OnlinePaymentFakeApprovePage,
    2929    ExportPDFClearanceSlipPage, StudentBaseManageFormPage,
    3030    StudentBaseEditFormPage, StudentPersonalEditFormPage,
     
    3232    OnlinePaymentBreadcrumb, ExportPDFPaymentSlipPage)
    3333from waeup.kofa.students.viewlets import (
    34     RequestCallbackActionButton, PaymentReceiptActionButton)
     34    PaymentReceiptActionButton)
    3535from waeup.uniben.students.interfaces import (
    3636    ICustomStudentBase, ICustomStudent, ICustomStudentPersonal,
     
    184184        return payment
    185185
     186class CustomOnlinePaymentFakeApprovePage(OnlinePaymentFakeApprovePage):
     187    """ Disable payment approval view for students.
     188
     189    This view is used for browser tests only and
     190    has to be neutralized here!
     191    """
     192
     193    grok.name('fake_approve')
     194    grok.require('waeup.managePortal')
     195
     196    def update(self):
     197        return
     198
    186199class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage):
    187200    """Deliver a PDF slip of the context.
  • main/waeup.uniben/trunk/src/waeup/uniben/students/payments.py

    r8247 r8421  
    2323from zope.interface import implementedBy
    2424from waeup.kofa.students.interfaces import IStudentNavigation
    25 from waeup.kofa.payments import PaymentsContainer, OnlinePayment
     25from waeup.kofa.students.payments import StudentOnlinePayment
    2626from waeup.kofa.utils.helpers import attrs_to_fields
    2727from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment
    2828
    29 class CustomStudentOnlinePayment(OnlinePayment):
    30     """This is an online payment.
     29class CustomStudentOnlinePayment(StudentOnlinePayment):
     30    """This is a custom online payment for students.
     31
     32    Since this class inherits from StudentOnlinePayment, it automatically
     33    implements the interfaces of the parent class which means
     34    all viewlets and views meant for StudentOnlinePayment
     35    can also be accessed in the customized system.
    3136    """
    3237    grok.implements(ICustomStudentOnlinePayment, IStudentNavigation)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r8413 r8421  
    124124                # has paid for.
    125125                details['p_session'], details['p_level'] = self.getReturningData(student)
    126         if details['amount'] == 0.0:
     126        if details['amount'] in (0.0, None):
    127127            details['error'] = _(u'Amount could not be determined.')
    128128        return details
Note: See TracChangeset for help on using the changeset viewer.