Ignore:
Timestamp:
17 Mar 2013, 08:40:59 (12 years ago)
Author:
Henrik Bettermann
Message:

Use better class names. The PaymentWebservice? adapter is not a webservice. KofaPaymentRequest? is not a request but a view for a simple web service.

We do not publish the data of the payee but of the payer.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py

    r9984 r10030  
    2727from waeup.kofa.interfaces import MessageFactory as _
    2828from waeup.kofa.payments import OnlinePayment
    29 from waeup.kofa.payments.interfaces import IPaymentWebservice
     29from waeup.kofa.payments.interfaces import IPayer
    3030from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment
    3131from waeup.kofa.utils.helpers import attrs_to_fields
     
    7878    ApplicantOnlinePayment, omit=['display_item'])
    7979
    80 class PaymentWebservice(grok.Adapter):
    81     """An adapter to publish applicant data through a webservice.
     80class Payer(grok.Adapter):
     81    """An adapter to publish applicant data through a simple webservice.
    8282    """
    8383    grok.context(IApplicantOnlinePayment)
    84     grok.implements(IPaymentWebservice)
     84    grok.implements(IPayer)
    8585
    8686    @property
    8787    def display_fullname(self):
    88         "Name of  payee"
     88        "Name of  payer"
    8989        return self.context.__parent__.display_fullname
    9090
    9191    @property
    9292    def id(self):
    93         "Id of payee"
     93        "Id of payer"
    9494        return self.context.__parent__.applicant_id
    9595
    9696    @property
    9797    def reg_number(self):
    98         "Reg number of payee"
     98        "Reg number of payer"
    9999        return self.context.__parent__.reg_number
    100100
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r9929 r10030  
    3737from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    3838from waeup.kofa.app import University
    39 from waeup.kofa.payments.interfaces import IPaymentWebservice
     39from waeup.kofa.payments.interfaces import IPayer
    4040from waeup.kofa.configuration import SessionConfiguration
    4141from waeup.kofa.applicants.container import ApplicantsContainer
     
    758758        self.assertEqual(payment.p_category,'application')
    759759        self.assertEqual(payment.amount_auth,200.0)
    760         # Applicant is payee of the payment ticket.
     760        # Applicant is payer of the payment ticket.
    761761        self.assertEqual(
    762             IPaymentWebservice(payment).display_fullname, 'John Anthony Tester')
     762            IPayer(payment).display_fullname, 'John Anthony Tester')
    763763        self.assertEqual(
    764             IPaymentWebservice(payment).id, self.applicant.applicant_id)
    765         self.assertEqual(IPaymentWebservice(payment).faculty, '')
    766         self.assertEqual(IPaymentWebservice(payment).department, '')
     764            IPayer(payment).id, self.applicant.applicant_id)
     765        self.assertEqual(IPayer(payment).faculty, '')
     766        self.assertEqual(IPayer(payment).department, '')
    767767        # The pdf payment slip can't yet be opened
    768768        #self.browser.open(payment_url + '/payment_receipt.pdf')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_payment.py

    r9533 r10030  
    2222from zope.interface import verify
    2323from waeup.kofa.applicants.payment import (
    24     ApplicantOnlinePayment, ApplicantOnlinePaymentFactory, PaymentWebservice)
    25 from waeup.kofa.payments.interfaces import IOnlinePayment, IPaymentWebservice
     24    ApplicantOnlinePayment, ApplicantOnlinePaymentFactory, Payer)
     25from waeup.kofa.payments.interfaces import IOnlinePayment, IPayer
    2626
    2727class ApplicantOnlinePaymentFactoryTest(unittest.TestCase):
     
    3939        assert implemented_by.isOrExtends(IOnlinePayment)
    4040
    41     def test_webservice_interface(self):
    42         verify.verifyClass(IPaymentWebservice, PaymentWebservice)
     41    def test_payer_interface(self):
     42        verify.verifyClass(IPayer, Payer)
Note: See TracChangeset for help on using the changeset viewer.