import grok from waeup.ikoba.interfaces import MessageFactory as _ from waeup.ikoba.payments.interfaces import IPaymentGatewayService from waeup.ikoba.payments.payment import Payment class DemoCreditcardPaymentService(grok.GlobalUtility): """A demo payment gateway service. This one supports credit card payments. """ grok.implements(IPaymentGatewayService) grok.name('demo_creditcard') title = _(u'Demo Creditcard') def create_payment(self, payer, payment_item_list=[], payee=None): """Create a payment. """ payment = Payment() payment.gateway_service = 'demo_creditcard' # must be grok.name above payment.payer_id = payer.payer_id for item in payment_item_list: payment.add_payment_item(item) return payment