Changeset 9755 for main


Ignore:
Timestamp:
1 Dec 2012, 10:05:53 (12 years ago)
Author:
Henrik Bettermann
Message:

Define PAYMENT_CATEGORIES in CustomKofaUtils?.

Fix tests.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py

    r9508 r9755  
    5454        IWorkflowState(self.student).setState('cleared')
    5555        self.browser.open(self.payments_path + '/addop')
     56        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
    5657        self.browser.getControl("Create ticket").click()
    5758        self.assertMatches('...ticket created...',
  • main/waeup.aaue/trunk/src/waeup/aaue/payments/interfaces.py

    r9327 r9755  
    1616## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    1717##
    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 _
     18from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment
    2319
    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):
     20class ICustomOnlinePayment(INigeriaOnlinePayment):
    3721    """A payment via payment gateways.
    3822
    39     This is a copy of INigeriaOnlinePayment
    40     only for taking the AAUE payment_categories
    41     into consideration.
    4223    """
    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
  • main/waeup.aaue/trunk/src/waeup/aaue/students/payments.py

    r8753 r9755  
    2727from waeup.kofa.utils.helpers import attrs_to_fields
    2828from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment
    29 from waeup.aaue.payments.interfaces import payment_categories
    3029
    3130class CustomStudentOnlinePayment(StudentOnlinePayment):
     
    4847        return self.__parent__.__parent__
    4948
    50     @property
    51     def category(self):
    52         return payment_categories.getTermByToken(self.p_category).title
    53 
    5449CustomStudentOnlinePayment = attrs_to_fields(CustomStudentOnlinePayment)
    5550
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r9527 r9755  
    9292        self.browser.open(self.payments_path)
    9393        self.browser.getLink("Add current session payment ticket").click()
     94        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
    9495        self.browser.getControl("Create ticket").click()
    9596        self.assertMatches('...Wrong state...',
     
    101102                           self.browser.contents)
    102103        self.app['configuration']['2004'].school_fee_base = 6666.0
     104        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
    103105        self.browser.getControl("Create ticket").click()
    104106        self.assertMatches('...ticket created...',
     
    117119        ticket.p_state = 'paid'
    118120        self.browser.open(self.payments_path + '/addop')
     121        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
    119122        self.browser.getControl("Create ticket").click()
    120123        self.assertMatches('...This type of payment has already been made...',
  • main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py

    r8823 r9755  
    2626    PREFERRED_LANGUAGES_DICT = {
    2727        }
     28
     29    PAYMENT_CATEGORIES = {
     30        'schoolfee': 'School Fee',
     31        'schoolfee_1': 'School Fee 1st instalment',
     32        'schoolfee_2': 'School Fee 2nd instalment',
     33        'clearance': 'Acceptance Fee',
     34        'hostel_maintenance': 'Hostel Maintenance Fee',
     35        'application': 'Application Fee',
     36        'gown': 'Gown Hire Fee',
     37        'bed_allocation': 'Bed Allocation Fee',
     38        'transfer': 'Transfer Fee',
     39        }
     40
     41    SELECTABLE_PAYMENT_CATEGORIES = {
     42        'schoolfee_1': 'School Fee 1st instalment',
     43        'schoolfee_2': 'School Fee 2nd instalment',
     44        'clearance': 'Acceptance Fee',
     45        'hostel_maintenance': 'Hostel Maintenance Fee',
     46        'application': 'Application Fee',
     47        'gown': 'Gown Hire Fee',
     48        'bed_allocation': 'Bed Allocation Fee',
     49        'transfer': 'Transfer Fee',
     50        }
     51
Note: See TracChangeset for help on using the changeset viewer.