Ignore:
Timestamp:
11 May 2012, 14:18:47 (12 years ago)
Author:
Henrik Bettermann
Message:

Add methods for approving payments and implement pages for approving payments (work in progress).

Location:
main/waeup.kofa/trunk/src/waeup/kofa/payments
Files:
2 edited

Legend:

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

    r8260 r8420  
    130130        readonly = False,
    131131        )
     132
     133    def approve():
     134        "Approve an online payment and set to paid."
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/payment.py

    r8194 r8420  
    2424from zope.component import getUtility
    2525from waeup.kofa.interfaces import IKofaUtils
     26from waeup.kofa.interfaces import MessageFactory as _
    2627from waeup.kofa.payments.interfaces import (
    2728    IPayment, ISCPayment, IOnlinePayment,
    2829    payment_states, payment_categories)
    29 from waeup.kofa.utils.helpers import attrs_to_fields
     30from waeup.kofa.utils.helpers import attrs_to_fields, get_current_principal
    3031
    3132class Payment(grok.Container):
     
    5051        return payment_categories.getTermByToken(self.p_category).title
    5152
     53# not used
    5254class SCPayment(Payment):
    5355    """This is a scratch card payment.
     
    7476        return
    7577
     78    def approve(self):
     79        "Approve online payment and set to paid."
     80        self.r_amount_approved = self.amount_auth
     81        self.r_code = u'AP'
     82        self.p_state = 'paid'
     83        #user = get_current_principal()
     84        self.payment_date = datetime.utcnow()
     85        return
     86
    7687OnlinePayment = attrs_to_fields(OnlinePayment)
Note: See TracChangeset for help on using the changeset viewer.