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

Last change on this file since 14760 was 14760, checked in by Henrik Bettermann, 7 years ago

Switch to https.

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1## $Id: browser.py 14760 2017-08-03 09:10:44Z 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    RemitaRequestPaymentStatusPageStudent,
22    RemitaPageStudent)
23
24class CustomRemitaRequestPaymentStatusPageStudent(
25    RemitaRequestPaymentStatusPageStudent):
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 = True
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
49    action = 'http://www.remitademo.net/remita/ecomm/finalize.reg'
50
51    @property
52    def lineitems(self):
53        ba1 = self.context.amount_auth / 2
54        ba2 = self.context.amount_auth / 2
55        lineitems = (
56                      {"lineItemsId":"itemid1","beneficiaryName":"Klaus Mueller",
57                      "beneficiaryAccount":"6020067886","bankCode":"011",
58                      "beneficiaryAmount":str(ba1),"deductFeeFrom":"1"},
59                      {"lineItemsId":"itemid2","beneficiaryName":"Werner Rumm",
60                      "beneficiaryAccount":"0360883515","bankCode":"050",
61                      "beneficiaryAmount":str(ba2),"deductFeeFrom":"0"}
62                    )
63        return lineitems
64
65    def update(self):
66        if not module_activated(self.context.student.current_session):
67            return
68        self.orderId = self.context.p_id
69        self.amount = str(self.context.amount_auth)
70        error = self.init_update()
71        if error:
72            self.flash(error, type='danger')
73            self.redirect(self.url(self.context, '@@index'))
74            return
75        return
Note: See TracBrowser for help on using the repository browser.