[8862] | 1 | ## $Id: interfaces.py 17239 2022-12-23 17:19:33Z uli $ |
---|
| 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 | |
---|
| 29 | ac = schema.TextLine( |
---|
| 30 | title = _(u'Activation Code'), |
---|
| 31 | default = None, |
---|
| 32 | required = False, |
---|
| 33 | readonly = False, |
---|
| 34 | ) |
---|
| 35 | |
---|
| 36 | r_amount_approved = schema.Float( |
---|
| 37 | title = _(u'Response Amount Approved'), |
---|
| 38 | default = 0.0, |
---|
| 39 | required = False, |
---|
| 40 | readonly = False, |
---|
| 41 | ) |
---|
| 42 | |
---|
| 43 | r_code = schema.TextLine( |
---|
| 44 | title = _(u'Response Code'), |
---|
| 45 | default = None, |
---|
| 46 | required = False, |
---|
| 47 | readonly = False, |
---|
| 48 | ) |
---|
| 49 | |
---|
| 50 | r_desc = schema.TextLine( |
---|
| 51 | title = _(u'Response Description'), |
---|
| 52 | default = None, |
---|
| 53 | required = False, |
---|
| 54 | readonly = False, |
---|
| 55 | ) |
---|
| 56 | |
---|
[8904] | 57 | # Only defined in kofacustom.nigeria package |
---|
[8862] | 58 | |
---|
| 59 | r_pay_reference = schema.TextLine( |
---|
| 60 | title = _(u'Response Payment Reference'), |
---|
| 61 | default = None, |
---|
| 62 | required = False, |
---|
| 63 | readonly = False, |
---|
| 64 | ) |
---|
| 65 | |
---|
| 66 | r_card_num = schema.TextLine( |
---|
| 67 | title = _(u'Response Card Number'), |
---|
| 68 | default = None, |
---|
| 69 | required = False, |
---|
| 70 | readonly = False, |
---|
| 71 | ) |
---|
[8943] | 72 | |
---|
| 73 | r_company = schema.Choice( |
---|
| 74 | title = _(u'Payment Gateway'), |
---|
| 75 | default = None, |
---|
| 76 | required = False, |
---|
| 77 | readonly = False, |
---|
| 78 | vocabulary = SimpleKofaVocabulary( |
---|
| 79 | (_('Interswitch'), 'interswitch'), |
---|
[15702] | 80 | (_('Etranzact'), 'etranzact'), |
---|
[14738] | 81 | (_('Remita'), 'remita'), |
---|
[17239] | 82 | (_('Paypal'), 'paypal'), |
---|
[13724] | 83 | (_('Scratch Card'), 'sc'), |
---|
| 84 | (_('Manifest'), 'manifest'), |
---|
[13743] | 85 | (_('Sponsor'), 'sponsored'), |
---|
[15845] | 86 | (_('unknown'), 'unknown'), |
---|
[13724] | 87 | ) |
---|
[8943] | 88 | ) |
---|
| 89 | |
---|
[17239] | 90 | r_payment_link = schema.TextLine( |
---|
| 91 | title = _(u'Response Payment Authorization Link'), |
---|
| 92 | default = None, |
---|
| 93 | required = False, |
---|
| 94 | readonly = False, |
---|
| 95 | ) |
---|
| 96 | |
---|
[9774] | 97 | provider_amt = schema.Float( |
---|
[16232] | 98 | title = _(u'Portal Charge'), |
---|
[9774] | 99 | default = 0.0, |
---|
| 100 | required = False, |
---|
| 101 | readonly = False, |
---|
| 102 | ) |
---|
| 103 | |
---|
| 104 | gateway_amt = schema.Float( |
---|
| 105 | title = _(u'Gateway Amount'), |
---|
| 106 | default = 0.0, |
---|
| 107 | required = False, |
---|
| 108 | readonly = False, |
---|
| 109 | ) |
---|
| 110 | |
---|
| 111 | thirdparty_amt = schema.Float( |
---|
| 112 | title = _(u'Third Party Amount'), |
---|
| 113 | default = 0.0, |
---|
| 114 | required = False, |
---|
| 115 | readonly = False, |
---|
| 116 | ) |
---|
| 117 | |
---|
[15730] | 118 | net_amt = schema.Float( |
---|
| 119 | title = _(u'Net Amount'), |
---|
| 120 | default = 0.0, |
---|
| 121 | required = False, |
---|
[15755] | 122 | readonly = False, |
---|
[15730] | 123 | ) |
---|
| 124 | |
---|
| 125 | INigeriaOnlinePayment['net_amt'].order = INigeriaOnlinePayment[ |
---|
[17239] | 126 | 'amount_auth'].order |
---|