source: main/waeup.ikoba/branches/uli-fake-gw-provider/src/waeup/ikoba/payments/demo_provider.py @ 12646

Last change on this file since 12646 was 12637, checked in by uli, 10 years ago

Foundations for a demo payment gateway.

File size: 799 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')
14
15    title = _(u'Demo Creditcard')
16
17    def create_payment(self, payer, payment_item,  payee=None):
18        """Create a payment.
19        """
20        payment = Payment()
21        payment.gateway_service = 'demo'  # must be grok.name above
22        payment.payed_item_id = payment_item.item_id
23        payment.amount = payment_item.amount
24        payment.payer_id = payer.payer_id
25        return payment
Note: See TracBrowser for help on using the repository browser.