Changeset 16526


Ignore:
Timestamp:
5 Jul 2021, 15:42:14 (3 years ago)
Author:
Henrik Bettermann
Message:

Extend IPayer adapter.

Location:
main/waeup.kofa/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r16518 r16526  
    441.7.2.dev0 (unreleased)
    55=======================
     6
     7* Extend `IPayer` adapter.
    68
    79* Adjust `ApplicantOnlinePaymentProcessor.getMapping` (2nd bugfix).
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py

    r16225 r16526  
    9494
    9595    @property
     96    def payer(self):
     97        "The payer object"
     98        return self.context.__parent__
     99
     100    @property
    96101    def display_fullname(self):
    97102        "Name of  payer"
     
    140145        return 'N/A'
    141146
     147    def doAfterPayment(self):
     148        "Do after payment was made."
     149        return self.context.__parent__.doAfterApplicantPayment()
     150
    142151# Applicant online payments must be importable. So we might need a factory.
    143152class ApplicantOnlinePaymentFactory(grok.GlobalUtility):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r16243 r16526  
    10181018        self.assertEqual(payment.amount_auth,200.0)
    10191019        # Applicant is payer of the payment ticket.
     1020        self.assertEqual(IPayer(payment).payer, self.applicant)
    10201021        self.assertEqual(
    10211022            IPayer(payment).display_fullname, 'John Anthony Tester')
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r16500 r16526  
    167167class IPayer(IKofaObject):
    168168    """An interface for an adapter to publish student and applicant data
    169     through a simple webservice.
     169    through a simple webservice. Also used in payment modules.
    170170
    171171    """
     172    payer = Attribute("The payer object")
    172173    display_fullname = Attribute('Name of payer')
    173174    id = Attribute('Id of payer')
     
    180181    current_mode= Attribute('Current study mode of payer')
    181182    current_level= Attribute('Current level of payer')
     183
     184    def doAfterPayment():
     185        "Do after payment was made."
  • main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py

    r15325 r16526  
    182182
    183183    @property
     184    def payer(self):
     185        "The payer object"
     186        return self.context.student
     187
     188    @property
    184189    def display_fullname(self):
    185190        "Name of  payer"
     
    230235        "Current level of payer"
    231236        return self.context.student.current_level
     237
     238    def doAfterPayment(self):
     239        "Do after payment was made."
     240        return self.context.student.doAfterStudentPayment()
    232241
    233242# Student online payments must be importable. So we might need a factory.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r16465 r16526  
    34083408        # Student is the payer of the payment ticket.
    34093409        payer = IPayer(self.student['payments'][value])
     3410        self.assertEqual(payer.payer, self.student)
    34103411        self.assertEqual(payer.display_fullname, 'Anna Tester')
    34113412        self.assertEqual(payer.id, self.student_id)
Note: See TracChangeset for help on using the changeset viewer.