Changeset 8245


Ignore:
Timestamp:
22 Apr 2012, 12:46:17 (12 years ago)
Author:
Henrik Bettermann
Message:

More preparations for a solid payment system customization.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8244 r8245  
    450450    factory = u'waeup.ApplicantOnlinePayment'
    451451
     452    def _fillCustomFields(self, payment, session_config):
     453        """No custom fields in the base package
     454        """
     455        pass
     456
    452457    def update(self):
    453458        p_category = 'acceptance'
    454459        session = str(self.context.__parent__.year)
    455460        try:
    456             academic_session = grok.getSite()['configuration'][session]
     461            session_config = grok.getSite()['configuration'][session]
    457462        except KeyError:
    458463            self.flash(_('Session configuration object is not available.'))
     
    469474        payment.p_id = "p%s" % timestamp
    470475        payment.p_item = self.context.__parent__.title
    471         payment.p_year = self.context.__parent__.year
     476        payment.p_session = self.context.__parent__.year
    472477        payment.p_category = p_category
    473         payment.amount_auth = academic_session.acceptance_fee
    474         #payment.surcharge_1 = academic_session.surcharge_1
    475         #payment.surcharge_2 = academic_session.surcharge_2
    476         #payment.surcharge_3 = academic_session.surcharge_3
     478        payment.amount_auth = session_config.acceptance_fee
     479        payment = self._fillCustomFields(payment, session_config)
    477480        self.context[payment.p_id] = payment
    478481        self.flash(_('Payment ticket created.'))
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r8203 r8245  
    2929from waeup.kofa.schema import TextLineChoice, FormattedDate
    3030from waeup.kofa.interfaces import (
    31     IKofaObject, year_range, validate_email, academic_sessions_vocab,
     31    IKofaObject, year_range, validate_email,
    3232    SimpleKofaVocabulary)
    3333from waeup.kofa.interfaces import MessageFactory as _
     
    511511
    512512    """
    513     p_year = schema.Choice(
    514         title = _(u'Payment Session'),
    515         source = academic_sessions_vocab,
    516         required = False,
    517         )
    518 
    519 IApplicantOnlinePayment['p_year'].order = IApplicantOnlinePayment[
    520     'p_year'].order
    521 
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r8244 r8245  
    1818from zope.interface import Attribute
    1919from zope import schema
    20 from waeup.kofa.interfaces import IKofaObject, SimpleKofaVocabulary
     20from waeup.kofa.interfaces import (
     21    IKofaObject, SimpleKofaVocabulary, academic_sessions_vocab)
    2122from waeup.kofa.interfaces import MessageFactory as _
    2223
     
    5859        title = _(u'Payment Item'),
    5960        default = None,
     61        required = False,
     62        )
     63
     64    p_session = schema.Choice(
     65        title = _(u'Payment Session'),
     66        source = academic_sessions_vocab,
    6067        required = False,
    6168        )
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8244 r8245  
    10541054    label = _('Add online payment')
    10551055    pnav = 4
     1056    factory = u'waeup.StudentOnlinePayment'
     1057
     1058    def _fillCustomFields(self, payment, pay_details):
     1059        """No custom fields in the base package
     1060        """
     1061        pass
    10561062
    10571063    @action(_('Create ticket'), style='primary')
     
    10921098                  self.redirect(self.url(self.context))
    10931099                  return
    1094         payment = createObject(u'waeup.StudentOnlinePayment')
     1100        payment = createObject(self.factory)
    10951101        self.applyData(payment, **data)
    10961102        timestamp = "%d" % int(time()*1000)
     
    10991105        payment.p_session = p_session
    11001106        payment.amount_auth = pay_details['amount']
    1101         #payment.surcharge_1 = pay_details['surcharge_1']
    1102         #payment.surcharge_2 = pay_details['surcharge_2']
    1103         #payment.surcharge_3 = pay_details['surcharge_3']
     1107        payment = self._fillCustomFields(payment, pay_details)
    11041108        self.context[payment.p_id] = payment
    11051109        self.flash(_('Payment ticket created.'))
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r8182 r8245  
    501501
    502502    """
    503     p_session = schema.Choice(
    504         title = _(u'Payment Session'),
    505         source = academic_sessions_vocab,
    506         required = False,
    507         )
    508503
    509504IStudentOnlinePayment['p_session'].order = IStudentOnlinePayment[
Note: See TracChangeset for help on using the changeset viewer.