Changeset 6869 for main/waeup.sirp/trunk/src/waeup/sirp/payments
- Timestamp:
- 10 Oct 2011, 16:50:11 (13 years ago)
- 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 1 1 ## 2 2 ## interfaces.py 3 from zope.interface import Attribute, invariant 3 4 from zope import schema 4 5 from waeup.sirp.interfaces import IWAeUPObject … … 15 16 16 17 """ 18 p_id = Attribute('Payment identifier.') 17 19 18 20 p_state = schema.Choice( … … 32 34 p_item = schema.TextLine( 33 35 title = u'Payment Item', 34 default = u'Certificate XYZ',36 default = None, 35 37 required = False, 36 38 ) 37 39 38 date_of_creation = schema.Date(40 creation_date = schema.Datetime( 39 41 title = u'Ticket Creation Date', 42 readonly = True, 40 43 ) 41 44 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, 44 49 ) 45 50 46 51 amount_auth = schema.Int( 47 title = u'Amount authorized',52 title = u'Amount Authorized', 48 53 default = 0, 49 54 required = True, 55 readonly = True, 50 56 ) 51 57 … … 59 65 default = u'Certificate XYZ', 60 66 required = False, 67 readonly = True, 61 68 ) 62 69 … … 70 77 default = 0, 71 78 required = False, 79 readonly = True, 72 80 ) 73 81 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 # ) 78 87 79 88 r_amount_approved = schema.Int( … … 81 90 default = 0, 82 91 required = False, 92 readonly = True, 83 93 ) 84 94 … … 86 96 title = u'Response Code', 87 97 default = None, 98 required = False, 99 readonly = True, 88 100 ) 89 101 … … 91 103 title = u'Response Card Number', 92 104 default = None, 105 required = False, 106 readonly = True, 93 107 ) -
main/waeup.sirp/trunk/src/waeup/sirp/payments/payment.py
r6866 r6869 18 18 """ 19 19 import grok 20 from datetime import datetime 20 21 from grok import index 21 22 from zope.component.interfaces import IFactory … … 24 25 IPayment, ISCPayment, IOnlinePayment) 25 26 from waeup.sirp.utils.helpers import attrs_to_fields 27 from waeup.sirp.payments.vocabularies import payment_states, payment_categories 26 28 27 29 class Payment(grok.Container): … … 34 36 def __init__(self): 35 37 super(Payment, self).__init__() 38 self.creation_date = datetime.now() 39 self.p_id = None 36 40 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 37 49 38 50 class SCPayment(Payment): … … 44 56 def __init__(self): 45 57 super(SCPayment, self).__init__() 58 p_id = None 46 59 return 47 60 … … 56 69 def __init__(self): 57 70 super(OnlinePayment, self).__init__() 71 p_id = None 58 72 return 59 73 -
main/waeup.sirp/trunk/src/waeup/sirp/payments/vocabularies.py
r6865 r6869 4 4 5 5 payment_states = SimpleWAeUPVocabulary( 6 (' not yet paid','unpaid'),7 (' paid','paid'),6 ('Not yet paid','unpaid'), 7 ('Paid','paid'), 8 8 ) 9 9
Note: See TracChangeset for help on using the changeset viewer.