[8862] | 1 | ## $Id: interfaces.py 15730 2019-10-31 20:14:47Z 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 |
---|
[8943] | 20 | from waeup.kofa.interfaces import SimpleKofaVocabulary |
---|
[8862] | 21 | from waeup.kofa.payments.interfaces import IPayment |
---|
| 22 | from kofacustom.nigeria.interfaces import MessageFactory as _ |
---|
| 23 | |
---|
[8863] | 24 | class INigeriaOnlinePayment(IPayment): |
---|
[8862] | 25 | """A payment via payment gateways. |
---|
| 26 | |
---|
| 27 | """ |
---|
| 28 | |
---|
[15730] | 29 | net_amount = Attribute('Total amount minus surcharges') |
---|
| 30 | |
---|
[8862] | 31 | ac = schema.TextLine( |
---|
| 32 | title = _(u'Activation Code'), |
---|
| 33 | default = None, |
---|
| 34 | required = False, |
---|
| 35 | readonly = False, |
---|
| 36 | ) |
---|
| 37 | |
---|
| 38 | r_amount_approved = schema.Float( |
---|
| 39 | title = _(u'Response Amount Approved'), |
---|
| 40 | default = 0.0, |
---|
| 41 | required = False, |
---|
| 42 | readonly = False, |
---|
| 43 | ) |
---|
| 44 | |
---|
| 45 | r_code = schema.TextLine( |
---|
| 46 | title = _(u'Response Code'), |
---|
| 47 | default = None, |
---|
| 48 | required = False, |
---|
| 49 | readonly = False, |
---|
| 50 | ) |
---|
| 51 | |
---|
| 52 | r_desc = schema.TextLine( |
---|
| 53 | title = _(u'Response Description'), |
---|
| 54 | default = None, |
---|
| 55 | required = False, |
---|
| 56 | readonly = False, |
---|
| 57 | ) |
---|
| 58 | |
---|
[8904] | 59 | # Only defined in kofacustom.nigeria package |
---|
[8862] | 60 | |
---|
| 61 | r_pay_reference = schema.TextLine( |
---|
| 62 | title = _(u'Response Payment Reference'), |
---|
| 63 | default = None, |
---|
| 64 | required = False, |
---|
| 65 | readonly = False, |
---|
| 66 | ) |
---|
| 67 | |
---|
| 68 | r_card_num = schema.TextLine( |
---|
| 69 | title = _(u'Response Card Number'), |
---|
| 70 | default = None, |
---|
| 71 | required = False, |
---|
| 72 | readonly = False, |
---|
| 73 | ) |
---|
[8943] | 74 | |
---|
| 75 | r_company = schema.Choice( |
---|
| 76 | title = _(u'Payment Gateway'), |
---|
| 77 | default = None, |
---|
| 78 | required = False, |
---|
| 79 | readonly = False, |
---|
| 80 | vocabulary = SimpleKofaVocabulary( |
---|
| 81 | (_('Interswitch'), 'interswitch'), |
---|
[15702] | 82 | (_('Etranzact'), 'etranzact'), |
---|
[14738] | 83 | (_('Remita'), 'remita'), |
---|
[13724] | 84 | (_('Scratch Card'), 'sc'), |
---|
| 85 | (_('Manifest'), 'manifest'), |
---|
[13743] | 86 | (_('Sponsor'), 'sponsored'), |
---|
[13724] | 87 | ) |
---|
[8943] | 88 | ) |
---|
| 89 | |
---|
[9774] | 90 | provider_amt = schema.Float( |
---|
| 91 | title = _(u'BT Amount'), |
---|
| 92 | default = 0.0, |
---|
| 93 | required = False, |
---|
| 94 | readonly = False, |
---|
| 95 | ) |
---|
| 96 | |
---|
| 97 | gateway_amt = schema.Float( |
---|
| 98 | title = _(u'Gateway Amount'), |
---|
| 99 | default = 0.0, |
---|
| 100 | required = False, |
---|
| 101 | readonly = False, |
---|
| 102 | ) |
---|
| 103 | |
---|
| 104 | thirdparty_amt = schema.Float( |
---|
| 105 | title = _(u'Third Party Amount'), |
---|
| 106 | default = 0.0, |
---|
| 107 | required = False, |
---|
| 108 | readonly = False, |
---|
| 109 | ) |
---|
| 110 | |
---|
[15730] | 111 | net_amt = schema.Float( |
---|
| 112 | title = _(u'Net Amount'), |
---|
| 113 | default = 0.0, |
---|
| 114 | required = False, |
---|
| 115 | readonly = True, |
---|
| 116 | ) |
---|
| 117 | |
---|
| 118 | INigeriaOnlinePayment['net_amt'].order = INigeriaOnlinePayment[ |
---|
| 119 | 'amount_auth'].order |
---|