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.

File:
1 edited

Legend:

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

    r10007 r10030  
    2020from zope.component import getUtility
    2121from zope.catalog.interfaces import ICatalog
    22 from waeup.kofa.payments.interfaces import IPaymentWebservice
     22from waeup.kofa.payments.interfaces import IPayer
    2323from waeup.kofa.interfaces import IUniversity, academic_sessions_vocab
    2424
    25 # Kofa's webservices to requery payments from outside
     25class PaymentDataWebservice(grok.View):
     26    """A simple webservice to publish payment and payer details on request from
     27    accepted IP addresses without authentication.
    2628
    27 class KofaPaymentRequest(grok.View):
    28 
     29    """
    2930    grok.context(IUniversity)
    3031    grok.name('paymentrequest')
     
    4041        real_ip = self.request.get('HTTP_X_FORWARDED_FOR', None)
    4142        if real_ip:
    42             self.context.logger.info('KofaPaymentRequest called: %s' % real_ip)
     43            self.context.logger.info('PaymentDataWebservice called: %s' % real_ip)
    4344        if real_ip and self.ACCEPTED_IP:
    4445            if real_ip not in  self.ACCEPTED_IP:
     
    5253            return
    5354        try:
    54             owner = IPaymentWebservice(results[0])
     55            owner = IPayer(results[0])
    5556            full_name = owner.display_fullname
    5657            reg_number = owner.reg_number
Note: See TracChangeset for help on using the changeset viewer.