Ignore:
Timestamp:
5 Oct 2011, 10:17:04 (13 years ago)
Author:
Henrik Bettermann
Message:

Add payment components and interfaces.

One single test module is enough.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/payments
Files:
3 added
1 deleted
2 edited

Legend:

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

    r6861 r6864  
    33# Make this a package.
    44from waeup.sirp.payments.container import PaymentsContainer
     5from waeup.sirp.payments.payment import SCPayment, OnlinePayment
    56
    67__all__ = [
    78    'PaymentsContainer',
     9    'SCPayment',
     10    'OnlinePayment',
    811    ]
  • main/waeup.sirp/trunk/src/waeup/sirp/payments/interfaces.py

    r6861 r6864  
    11##
    22## interfaces.py
     3from zope import schema
    34from waeup.sirp.interfaces import IWAeUPObject
     5from waeup.sirp.payments.vocabularies import (
     6    payment_states, payment_categories)
    47
    58class IPaymentsContainer(IWAeUPObject):
     
    710
    811    """
     12
     13class IPayment(IWAeUPObject):
     14    """A base representation of payments.
     15
     16    """
     17
     18    p_state = schema.Choice(
     19        title = u'Payment State',
     20        default = u'unpaid',
     21        vocabulary = payment_states,
     22        required = True,
     23        )
     24
     25    p_category = schema.Choice(
     26        title = u'Payment Category',
     27        default = u'school fee',
     28        vocabulary = payment_categories,
     29        required = True,
     30        )
     31
     32    p_item = schema.TextLine(
     33        title = u'Payment Item',
     34        default = u'Certificate XYZ',
     35        required = False,
     36        )
     37
     38    date_of_creation = schema.Date(
     39        title = u'Ticket Creation Date',
     40        )
     41
     42    date_of_payment = schema.Date(
     43        title = u'Date of Payment',
     44        )
     45
     46    amount_auth = schema.Int(
     47        title = u'Amount authorized',
     48        default = 0,
     49        required = True,
     50        )
     51
     52class ISCPayment(IPayment):
     53    """A scratch card payment.
     54
     55    """
     56
     57    p_code = schema.TextLine(
     58        title = u'Payment Access Code',
     59        default = u'Certificate XYZ',
     60        required = False,
     61        )
     62
     63class IOnlinePayment(IPayment):
     64    """A payment via payment gateways.
     65
     66    """
     67
     68    surcharge = schema.Int(
     69        title = u'Surcharge',
     70        default = 0,
     71        required = False,
     72        )
     73
     74    order_id = schema.TextLine(
     75        title = u'Order Id',
     76        default = None,
     77        )
     78
     79    r_amount_approved = schema.Int(
     80        title = u'Response Amount Approved',
     81        default = 0,
     82        required = False,
     83        )
     84
     85    r_code = schema.TextLine(
     86        title = u'Response Code',
     87        default = None,
     88        )
     89
     90    r_card_num = schema.TextLine(
     91        title = u'Response Card Number',
     92        default = None,
     93        )
Note: See TracChangeset for help on using the changeset viewer.