source: main/waeup.ikoba/trunk/src/waeup/ikoba/payments/demo_provider.py @ 12704

Last change on this file since 12704 was 12671, checked in by uli, 10 years ago

Merge changes from uli-fake-gw-provider back into trunk.

File size: 813 bytes
Line 
1import grok
2from waeup.ikoba.interfaces import MessageFactory as _
3from waeup.ikoba.payments.interfaces import IPaymentGatewayService
4from waeup.ikoba.payments.payment import Payment
5
6
7class DemoCreditcardPaymentService(grok.GlobalUtility):
8    """A demo payment gateway service.
9
10    This one supports credit card payments.
11    """
12    grok.implements(IPaymentGatewayService)
13    grok.name('demo_creditcard')
14
15    title = _(u'Demo Creditcard')
16
17    def create_payment(self, payer, payment_item_list=[],  payee=None):
18        """Create a payment.
19        """
20        payment = Payment()
21        payment.gateway_service = 'demo_creditcard'  # must be grok.name above
22        payment.payer_id = payer.payer_id
23        for item in payment_item_list:
24            payment.add_payment_item(item)
25        return payment
Note: See TracBrowser for help on using the repository browser.