Changeset 12725


Ignore:
Timestamp:
11 Mar 2015, 08:56:18 (10 years ago)
Author:
uli
Message:

Add interface for payables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/interfaces.py

    r12720 r12725  
    146146class IPayableFinder(Interface):
    147147    """Finds payables.
     148
     149    For each type of content you want to make payable, you should
     150    define an IPayableFinder that can lookup payables in the
     151    site.
     152
     153    This enables access from payments (which store payable ids only)
     154    to arbitrary content objects (for which a payable finder is
     155    registered under some name).
     156
     157    The other way round (getting an id and other relevant data from
     158    any content object) is ensured by IPayable adapters.
    148159    """
    149160    def get_payable_by_id(item_id):
    150161        """Get an item by its Id, or none.
    151162        """
     163
     164
     165class IPayable(Interface):
     166    """Something that can be payed.
     167
     168    Designed to serve as adapter. IPayables turn arbitrary content
     169    objects into something with a standarized interfaces for use with
     170    payments.
     171    """
     172    payable_id = schema.TextLine(
     173        title=u'ID of a payable',
     174        description=(u'It should be possible to lookup the payable id '
     175                     u'by some registered IPayableFinder later on'),
     176        required=True,
     177        readonly=True,
     178        )
     179
     180    title = schema.TextLine(
     181        title=u'Title',
     182        description=u'A short description of the payed item.',
     183        required=True,
     184        default=u'',
     185        readonly=True,
     186        )
    152187
    153188
Note: See TracChangeset for help on using the changeset viewer.