Ignore:
Timestamp:
10 Oct 2011, 16:50:11 (13 years ago)
Author:
Henrik Bettermann
Message:

Add user interfaces to add, remove and manage student online payments.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/payments
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/payments/interfaces.py

    r6865 r6869  
    11##
    22## interfaces.py
     3from zope.interface import Attribute, invariant
    34from zope import schema
    45from waeup.sirp.interfaces import IWAeUPObject
     
    1516
    1617    """
     18    p_id = Attribute('Payment identifier.')
    1719
    1820    p_state = schema.Choice(
     
    3234    p_item = schema.TextLine(
    3335        title = u'Payment Item',
    34         default = u'Certificate XYZ',
     36        default = None,
    3537        required = False,
    3638        )
    3739
    38     date_of_creation = schema.Date(
     40    creation_date = schema.Datetime(
    3941        title = u'Ticket Creation Date',
     42        readonly = True,
    4043        )
    4144
    42     date_of_payment = schema.Date(
    43         title = u'Date of Payment',
     45    payment_date = schema.Date(
     46        title = u'Payment Date',
     47        required = False,
     48        readonly = True,
    4449        )
    4550
    4651    amount_auth = schema.Int(
    47         title = u'Amount authorized',
     52        title = u'Amount Authorized',
    4853        default = 0,
    4954        required = True,
     55        readonly = True,
    5056        )
    5157
     
    5965        default = u'Certificate XYZ',
    6066        required = False,
     67        readonly = True,
    6168        )
    6269
     
    7077        default = 0,
    7178        required = False,
     79        readonly = True,
    7280        )
    7381
    74     order_id = schema.TextLine(
    75         title = u'Order Id',
    76         default = None,
    77         )
     82    #order_id = schema.TextLine(
     83    #    title = u'Order Id',
     84    #    default = None,
     85    #    required = True,
     86    #    )
    7887
    7988    r_amount_approved = schema.Int(
     
    8190        default = 0,
    8291        required = False,
     92        readonly = True,
    8393        )
    8494
     
    8696        title = u'Response Code',
    8797        default = None,
     98        required = False,
     99        readonly = True,
    88100        )
    89101
     
    91103        title = u'Response Card Number',
    92104        default = None,
     105        required = False,
     106        readonly = True,
    93107        )
  • main/waeup.sirp/trunk/src/waeup/sirp/payments/payment.py

    r6866 r6869  
    1818"""
    1919import grok
     20from datetime import datetime
    2021from grok import index
    2122from zope.component.interfaces import IFactory
     
    2425    IPayment, ISCPayment, IOnlinePayment)
    2526from waeup.sirp.utils.helpers import attrs_to_fields
     27from waeup.sirp.payments.vocabularies import payment_states, payment_categories
    2628
    2729class Payment(grok.Container):
     
    3436    def __init__(self):
    3537        super(Payment, self).__init__()
     38        self.creation_date = datetime.now()
     39        self.p_id = None
    3640        return
     41
     42    @property
     43    def state(self):
     44        return payment_states.getTermByToken(self.p_state).title
     45
     46    @property
     47    def category(self):
     48        return payment_categories.getTermByToken(self.p_category).title
    3749
    3850class SCPayment(Payment):
     
    4456    def __init__(self):
    4557        super(SCPayment, self).__init__()
     58        p_id = None
    4659        return
    4760
     
    5669    def __init__(self):
    5770        super(OnlinePayment, self).__init__()
     71        p_id = None
    5872        return
    5973
  • main/waeup.sirp/trunk/src/waeup/sirp/payments/vocabularies.py

    r6865 r6869  
    44
    55payment_states = SimpleWAeUPVocabulary(
    6     ('not yet paid','unpaid'),
    7     ('paid','paid'),
     6    ('Not yet paid','unpaid'),
     7    ('Paid','paid'),
    88    )
    99
Note: See TracChangeset for help on using the changeset viewer.