[8862] | 1 | ## $Id: interfaces.py 17246 2022-12-28 09:57:26Z 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 |
---|
[17246] | 20 | from waeup.kofa.interfaces import ( |
---|
| 21 | SimpleKofaVocabulary, ContextualDictSourceFactoryBase) |
---|
[8862] | 22 | from waeup.kofa.payments.interfaces import IPayment |
---|
| 23 | from kofacustom.nigeria.interfaces import MessageFactory as _ |
---|
| 24 | |
---|
[17246] | 25 | class CurrencySymbolSource(ContextualDictSourceFactoryBase): |
---|
| 26 | """A payment category source delivers all categories of payments. |
---|
| 27 | |
---|
| 28 | """ |
---|
| 29 | DICT_NAME = 'CURRENCY_DICT' |
---|
| 30 | |
---|
[8863] | 31 | class INigeriaOnlinePayment(IPayment): |
---|
[8862] | 32 | """A payment via payment gateways. |
---|
| 33 | |
---|
| 34 | """ |
---|
| 35 | |
---|
| 36 | ac = schema.TextLine( |
---|
| 37 | title = _(u'Activation Code'), |
---|
| 38 | default = None, |
---|
| 39 | required = False, |
---|
| 40 | readonly = False, |
---|
| 41 | ) |
---|
| 42 | |
---|
| 43 | r_amount_approved = schema.Float( |
---|
| 44 | title = _(u'Response Amount Approved'), |
---|
| 45 | default = 0.0, |
---|
| 46 | required = False, |
---|
| 47 | readonly = False, |
---|
| 48 | ) |
---|
| 49 | |
---|
| 50 | r_code = schema.TextLine( |
---|
| 51 | title = _(u'Response Code'), |
---|
| 52 | default = None, |
---|
| 53 | required = False, |
---|
| 54 | readonly = False, |
---|
| 55 | ) |
---|
| 56 | |
---|
| 57 | r_desc = schema.TextLine( |
---|
| 58 | title = _(u'Response Description'), |
---|
| 59 | default = None, |
---|
| 60 | required = False, |
---|
| 61 | readonly = False, |
---|
| 62 | ) |
---|
| 63 | |
---|
[8904] | 64 | # Only defined in kofacustom.nigeria package |
---|
[8862] | 65 | |
---|
[17246] | 66 | p_currency = schema.Choice( |
---|
| 67 | title = _(u'Currency'), |
---|
| 68 | source = CurrencySymbolSource(), |
---|
| 69 | required = False, |
---|
| 70 | default = 'NGN', |
---|
| 71 | ) |
---|
| 72 | |
---|
[8862] | 73 | r_pay_reference = schema.TextLine( |
---|
| 74 | title = _(u'Response Payment Reference'), |
---|
| 75 | default = None, |
---|
| 76 | required = False, |
---|
| 77 | readonly = False, |
---|
| 78 | ) |
---|
| 79 | |
---|
| 80 | r_card_num = schema.TextLine( |
---|
| 81 | title = _(u'Response Card Number'), |
---|
| 82 | default = None, |
---|
| 83 | required = False, |
---|
| 84 | readonly = False, |
---|
| 85 | ) |
---|
[8943] | 86 | |
---|
| 87 | r_company = schema.Choice( |
---|
| 88 | title = _(u'Payment Gateway'), |
---|
| 89 | default = None, |
---|
| 90 | required = False, |
---|
| 91 | readonly = False, |
---|
| 92 | vocabulary = SimpleKofaVocabulary( |
---|
| 93 | (_('Interswitch'), 'interswitch'), |
---|
[15702] | 94 | (_('Etranzact'), 'etranzact'), |
---|
[14738] | 95 | (_('Remita'), 'remita'), |
---|
[17242] | 96 | (_('Paypal'), 'paypal'), |
---|
[13724] | 97 | (_('Scratch Card'), 'sc'), |
---|
| 98 | (_('Manifest'), 'manifest'), |
---|
[13743] | 99 | (_('Sponsor'), 'sponsored'), |
---|
[15845] | 100 | (_('unknown'), 'unknown'), |
---|
[13724] | 101 | ) |
---|
[8943] | 102 | ) |
---|
| 103 | |
---|
[17242] | 104 | r_payment_link = schema.TextLine( |
---|
| 105 | title = _(u'Response Payment Authorization Link'), |
---|
| 106 | default = None, |
---|
| 107 | required = False, |
---|
| 108 | readonly = False, |
---|
| 109 | ) |
---|
| 110 | |
---|
[9774] | 111 | provider_amt = schema.Float( |
---|
[16232] | 112 | title = _(u'Portal Charge'), |
---|
[9774] | 113 | default = 0.0, |
---|
| 114 | required = False, |
---|
| 115 | readonly = False, |
---|
| 116 | ) |
---|
| 117 | |
---|
| 118 | gateway_amt = schema.Float( |
---|
| 119 | title = _(u'Gateway Amount'), |
---|
| 120 | default = 0.0, |
---|
| 121 | required = False, |
---|
| 122 | readonly = False, |
---|
| 123 | ) |
---|
| 124 | |
---|
| 125 | thirdparty_amt = schema.Float( |
---|
| 126 | title = _(u'Third Party Amount'), |
---|
| 127 | default = 0.0, |
---|
| 128 | required = False, |
---|
| 129 | readonly = False, |
---|
| 130 | ) |
---|
| 131 | |
---|
[15730] | 132 | net_amt = schema.Float( |
---|
| 133 | title = _(u'Net Amount'), |
---|
| 134 | default = 0.0, |
---|
| 135 | required = False, |
---|
[15755] | 136 | readonly = False, |
---|
[15730] | 137 | ) |
---|
| 138 | |
---|
| 139 | INigeriaOnlinePayment['net_amt'].order = INigeriaOnlinePayment[ |
---|
[17242] | 140 | 'amount_auth'].order |
---|
[17246] | 141 | INigeriaOnlinePayment['p_currency'].order = INigeriaOnlinePayment[ |
---|
| 142 | 'amount_auth'].order |
---|