Last change
on this file since 12693 was
12671,
checked in by uli, 10 years ago
|
Merge changes from uli-fake-gw-provider back into trunk.
|
File size:
813 bytes
|
Rev | Line | |
---|
[12637] | 1 | import grok |
---|
| 2 | from waeup.ikoba.interfaces import MessageFactory as _ |
---|
| 3 | from waeup.ikoba.payments.interfaces import IPaymentGatewayService |
---|
| 4 | from waeup.ikoba.payments.payment import Payment |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | class DemoCreditcardPaymentService(grok.GlobalUtility): |
---|
| 8 | """A demo payment gateway service. |
---|
| 9 | |
---|
| 10 | This one supports credit card payments. |
---|
| 11 | """ |
---|
| 12 | grok.implements(IPaymentGatewayService) |
---|
[12652] | 13 | grok.name('demo_creditcard') |
---|
[12637] | 14 | |
---|
| 15 | title = _(u'Demo Creditcard') |
---|
| 16 | |
---|
[12647] | 17 | def create_payment(self, payer, payment_item_list=[], payee=None): |
---|
[12637] | 18 | """Create a payment. |
---|
| 19 | """ |
---|
| 20 | payment = Payment() |
---|
[12652] | 21 | payment.gateway_service = 'demo_creditcard' # must be grok.name above |
---|
[12637] | 22 | payment.payer_id = payer.payer_id |
---|
[12647] | 23 | for item in payment_item_list: |
---|
| 24 | payment.add_payment_item(item) |
---|
[12637] | 25 | return payment |
---|
Note: See
TracBrowser for help on using the repository browser.