Changeset 12134


Ignore:
Timestamp:
4 Dec 2014, 02:29:29 (10 years ago)
Author:
uli
Message:

Conform to interface and generate unique ids.

File:
1 edited

Legend:

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

    r12114 r12134  
    1919These are the payment tickets.
    2020"""
     21import decimal
    2122import grok
     23import uuid
    2224from datetime import datetime
    2325from grok import index
     
    2830from waeup.ikoba.interfaces import MessageFactory as _
    2931from waeup.ikoba.payments.interfaces import (
    30     IPayment, IOnlinePayment,
     32    IPayment, IOnlinePayment, STATE_UNPAID, STATE_FAILED, STATE_PAID,
    3133    payment_states)
    3234from waeup.ikoba.utils.helpers import attrs_to_fields, get_current_principal
     
    5355        super(Payment, self).__init__()
    5456        self.creation_date = datetime.utcnow()
    55         self.p_id = u''  # XXX: Get a unique id here
     57        self.payment_date = None
     58        self.payment_id = u'PAY_' + unicode(uuid.uuid4().hex)
     59        self.amount = decimal.Decimal("0.00")
     60        self.payed_item_id = None
     61        self.payer_id = None
     62        self.state = STATE_UNPAID
    5663        return
    5764
Note: See TracChangeset for help on using the changeset viewer.