Ignore:
Timestamp:
5 Dec 2014, 23:16:13 (10 years ago)
Author:
uli
Message:

Remove OnlinePayment?. All payments are online payments.

Location:
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments
Files:
3 edited

Legend:

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

    r11949 r12157  
    33# Make this a package.
    44from waeup.ikoba.payments.container import PaymentsContainer
    5 from waeup.ikoba.payments.payment import OnlinePayment
     5from waeup.ikoba.payments.payment import Payment
    66
    77__all__ = [
    88    'PaymentsContainer',
    9     'OnlinePayment',
     9    'Payment',
    1010    ]
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/payment.py

    r12152 r12157  
    8080        self.state = STATE_FAILED
    8181        notify(grok.ObjectModifiedEvent(self))
    82 
    83 
    84 class OnlinePayment(Payment):
    85     """This is an online payment.
    86     """
    87     grok.implements(IOnlinePayment)
    88     grok.provides(IOnlinePayment)
    89 
    90     def approve(self):
    91         "Approve online payment and set to paid."
    92         self.r_amount_approved = self.amount_auth
    93         self.r_code = u'AP'
    94         self.p_state = 'paid'
    95         user = get_current_principal()
    96         if user is None:
    97             # in tests
    98             usertitle = 'system'
    99         else:
    100             usertitle = getattr(user, 'public_name', None)
    101             if not usertitle:
    102                 usertitle = user.title
    103         r_desc = _('Payment approved by ${a}', mapping={'a': usertitle})
    104         portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE
    105         self.r_desc = translate(r_desc, 'waeup.ikoba',
    106             target_language=portal_language)
    107         self.payment_date = datetime.utcnow()
    108         # Update catalog
    109         notify(grok.ObjectModifiedEvent(self))
    110         return
    111 
    112 OnlinePayment = attrs_to_fields(OnlinePayment, omit=['display_item'])
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_interfaces.py

    r12060 r12157  
    2020"""
    2121from zope.interface.verify import verifyClass, verifyObject
    22 from waeup.ikoba.payments.interfaces import (
    23     IPaymentsContainer, IOnlinePayment)
     22from waeup.ikoba.payments.interfaces import IPaymentsContainer
    2423from waeup.ikoba.payments.container import PaymentsContainer
    25 from waeup.ikoba.payments.payment import OnlinePayment
     24from waeup.ikoba.payments.payment import Payment
    2625from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase)
    2726
     
    4140                IPaymentsContainer, PaymentsContainer())
    4241            )
    43         self.assertTrue(
    44             verifyClass(
    45                 IOnlinePayment, OnlinePayment)
    46             )
    47         self.assertTrue(
    48             verifyObject(
    49                 IOnlinePayment, OnlinePayment())
    50             )
    5142        return
    5243
Note: See TracChangeset for help on using the changeset viewer.