source: main/waeup.uniben/trunk/src/waeup/uniben/remita/browser.py @ 14748

Last change on this file since 14748 was 14746, checked in by Henrik Bettermann, 8 years ago

Customize Remita views.

Add remita_enabled field to session configuration objects.

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1## $Id: browser.py 14746 2017-08-02 09:16:52Z henrik $
2##
3## Copyright (C) 2017 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
19from kofacustom.nigeria.remita.browser import (
20    module_activated,
21    RemitaPaymentRequestWebservicePageStudent,
22    RemitaPageStudent)
23
24class CustomRemitaPaymentRequestWebservicePageStudent(
25    RemitaPaymentRequestWebservicePageStudent):
26    """ Request webservice view for the Remita gateway.
27    """
28
29    # Here we use Remita test portal data
30    merchantId = '2547916'
31    host = 'www.remitademo.net'
32    https = False
33    api_key = '1946'
34
35class CustomRemitaPageStudent(RemitaPageStudent):
36    """ View which sends a POST request to the Remita payment gateway.
37    """
38
39    # Here we use Remita test portal data
40    merchantId = '2547916'
41    serviceTypeId = '4430731'
42    api_key = '1946'
43    #orderId = '3456346346'
44    host = 'www.remitademo.net'
45    init_url = '/remita/ecomm/split/init.reg'
46    #amount='1000'
47    https = True
48    lineitems = (
49                  {"lineItemsId":"itemid1","beneficiaryName":"Klaus Mueller",
50                  "beneficiaryAccount":"6020067886","bankCode":"011",
51                  "beneficiaryAmount":"500","deductFeeFrom":"1"},
52                  {"lineItemsId":"itemid2","beneficiaryName":"Werner Rumm",
53                  "beneficiaryAccount":"0360883515","bankCode":"050",
54                  "beneficiaryAmount":"500","deductFeeFrom":"0"}
55                )
56
57    action = 'http://www.remitademo.net/remita/ecomm/finalize.reg'
58
59    def update(self):
60        if not module_activated(self.context.student.current_session):
61            return
62        self.orderId = self.context.p_id
63        self.amount = str(self.context.amount_auth)
64        error = self.init_update()
65        if error:
66            self.flash(error, type='danger')
67            self.redirect(self.url(self.context, '@@index'))
68            return
69        return
Note: See TracBrowser for help on using the repository browser.