| 1 | ## $Id: interfaces.py 9327 2012-10-11 21:12:44Z henrik $ |
|---|
| 2 | ## |
|---|
| 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
|---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
|---|
| 5 | ## it under the terms of the GNU General Public License as published by |
|---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | ## (at your option) any later version. |
|---|
| 8 | ## |
|---|
| 9 | ## This program is distributed in the hope that it will be useful, |
|---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | ## GNU General Public License for more details. |
|---|
| 13 | ## |
|---|
| 14 | ## You should have received a copy of the GNU General Public License |
|---|
| 15 | ## along with this program; if not, write to the Free Software |
|---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 | ## |
|---|
| 18 | from zope.interface import Attribute |
|---|
| 19 | from zope import schema |
|---|
| 20 | from waeup.kofa.payments.interfaces import IPayment |
|---|
| 21 | from waeup.kofa.interfaces import SimpleKofaVocabulary |
|---|
| 22 | from waeup.aaue.interfaces import MessageFactory as _ |
|---|
| 23 | |
|---|
| 24 | payment_categories = SimpleKofaVocabulary( |
|---|
| 25 | (_('School Fee'),'schoolfee'), |
|---|
| 26 | (_('School Fee 1st instalment'),'schoolfee_1'), |
|---|
| 27 | (_('School Fee 2nd instalment'),'schoolfee_2'), |
|---|
| 28 | (_('Clearance'),'clearance'), |
|---|
| 29 | (_('Bed Allocation'),'bed_allocation'), |
|---|
| 30 | (_('Hostel Maintenance'),'hostel_maintenance'), |
|---|
| 31 | (_('Transfer'),'transfer'), |
|---|
| 32 | (_('Gown'),'gown'), |
|---|
| 33 | (_('Application Fee'), 'application'), |
|---|
| 34 | ) |
|---|
| 35 | |
|---|
| 36 | class ICustomOnlinePayment(IPayment): |
|---|
| 37 | """A payment via payment gateways. |
|---|
| 38 | |
|---|
| 39 | This is a copy of INigeriaOnlinePayment |
|---|
| 40 | only for taking the AAUE payment_categories |
|---|
| 41 | into consideration. |
|---|
| 42 | """ |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | p_category = schema.Choice( |
|---|
| 46 | title = _(u'Payment Category'), |
|---|
| 47 | default = u'schoolfee_1', |
|---|
| 48 | vocabulary = payment_categories, |
|---|
| 49 | required = True, |
|---|
| 50 | ) |
|---|
| 51 | |
|---|
| 52 | ac = schema.TextLine( |
|---|
| 53 | title = _(u'Activation Code'), |
|---|
| 54 | default = None, |
|---|
| 55 | required = False, |
|---|
| 56 | readonly = False, |
|---|
| 57 | ) |
|---|
| 58 | |
|---|
| 59 | r_amount_approved = schema.Float( |
|---|
| 60 | title = _(u'Response Amount Approved'), |
|---|
| 61 | default = 0.0, |
|---|
| 62 | required = False, |
|---|
| 63 | readonly = False, |
|---|
| 64 | ) |
|---|
| 65 | |
|---|
| 66 | r_code = schema.TextLine( |
|---|
| 67 | title = _(u'Response Code'), |
|---|
| 68 | default = None, |
|---|
| 69 | required = False, |
|---|
| 70 | readonly = False, |
|---|
| 71 | ) |
|---|
| 72 | |
|---|
| 73 | r_desc = schema.TextLine( |
|---|
| 74 | title = _(u'Response Description'), |
|---|
| 75 | default = None, |
|---|
| 76 | required = False, |
|---|
| 77 | readonly = False, |
|---|
| 78 | ) |
|---|
| 79 | |
|---|
| 80 | r_pay_reference = schema.TextLine( |
|---|
| 81 | title = _(u'Response Payment Reference'), |
|---|
| 82 | default = None, |
|---|
| 83 | required = False, |
|---|
| 84 | readonly = False, |
|---|
| 85 | ) |
|---|
| 86 | |
|---|
| 87 | r_card_num = schema.TextLine( |
|---|
| 88 | title = _(u'Response Card Number'), |
|---|
| 89 | default = None, |
|---|
| 90 | required = False, |
|---|
| 91 | readonly = False, |
|---|
| 92 | ) |
|---|
| 93 | |
|---|
| 94 | conf_number = schema.TextLine( |
|---|
| 95 | title = _(u'Confirmation Number'), |
|---|
| 96 | default = None, |
|---|
| 97 | required = False, |
|---|
| 98 | readonly = False, |
|---|
| 99 | ) |
|---|
| 100 | |
|---|
| 101 | r_company = schema.Choice( |
|---|
| 102 | title = _(u'Payment Gateway'), |
|---|
| 103 | default = None, |
|---|
| 104 | required = False, |
|---|
| 105 | readonly = False, |
|---|
| 106 | vocabulary = SimpleKofaVocabulary( |
|---|
| 107 | (_('Interswitch'), 'interswitch'), |
|---|
| 108 | (_('eTranzact'), 'etranzact'),) |
|---|
| 109 | ) |
|---|
| 110 | |
|---|
| 111 | ICustomOnlinePayment['p_category'].order = ICustomOnlinePayment[ |
|---|
| 112 | 'p_category'].order |
|---|