- Timestamp:
- 2 Mar 2015, 14:07:26 (10 years ago)
- Location:
- main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/interfaces.py
r12649 r12655 103 103 104 104 105 class IPaymentGatewayServicesLister(Interface): 106 """A utility that lists all valid payment gateways. 107 108 This is a subset of the available payment methods, as some might 109 be disabled in some site. 110 111 Register your own lister in customized sites! 112 """ 113 114 105 115 class PaymentCategorySource(ContextualDictSourceFactoryBase): 106 116 """A payment category source delivers all categories of payments. … … 222 232 ) 223 233 224 225 234 currency = schema.Choice( 226 235 title=u'Currency', -
main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/payment.py
r12648 r12655 29 29 IPayment, STATE_UNPAID, STATE_FAILED, STATE_PAID, 30 30 IPaymentGatewayService, IPayer, IPaymentItem, IPayee, 31 IPaymentGatewayServicesLister, 31 32 ) 32 33 from waeup.ikoba.utils.logger import Logger … … 39 40 getUtilitiesFor(IPaymentGatewayService) 40 41 ) 42 43 grok.global_utility(get_payment_providers, IPaymentGatewayServicesLister) 41 44 42 45 -
main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/tests/test_payment.py
r12648 r12655 20 20 import re 21 21 import unittest 22 from zope.component import getUtilitiesFor, getSiteManager 22 from zope.component import getUtilitiesFor, getSiteManager, queryUtility 23 23 from zope.interface import implements 24 24 from zope.interface.verify import verifyClass, verifyObject 25 25 from waeup.ikoba.payments.interfaces import ( 26 26 IPayment, STATE_UNPAID, STATE_PAID, STATE_FAILED, 27 IPaymentGatewayService, IPaymentItem 27 IPaymentGatewayService, IPaymentItem, IPaymentGatewayServicesLister, 28 28 ) 29 29 from waeup.ikoba.payments.payment import ( 30 30 Payment, get_payment_providers, PaymentItem, 31 31 ) 32 from waeup.ikoba.testing import (FunctionalLayer, FunctionalTestCase) 32 33 33 34 … … 59 60 assert result.keys() == ['some_name', ] 60 61 assert result['some_name'] is fake_util 62 63 class FunctionalHelperTests(FunctionalTestCase): 64 65 layer = FunctionalLayer 66 67 def test_services_lister_is_registered(self): 68 # a lister of gateway services is registered on startup 69 util = queryUtility(IPaymentGatewayServicesLister) 70 assert util is not None 61 71 62 72
Note: See TracChangeset for help on using the changeset viewer.