-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_pay_methods.php
114 lines (93 loc) · 3.97 KB
/
view_pay_methods.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/*
Module developed for the Open Source Content Management System WebsiteBaker (http://websitebaker.org)
Copyright (C) 2007 - 2017, Christoph Marti
LICENCE TERMS:
This module is free software. You can redistribute it and/or modify it
under the terms of the GNU General Public License - version 2 or later,
as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
DISCLAIMER:
This module is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
// Prevent this file from being accessed directly
if (defined('WB_PATH') == false) {
exit("Cannot access this file directly");
}
// Include WB template parser and create template object
require_once(WB_PATH.'/include/phplib/template.inc');
$tpl = new Template(WB_PATH.'/modules/bakery/templates/pay_methods');
// Define how to deal with unknown {PLACEHOLDERS} (remove:=default, keep, comment)
$tpl->set_unknowns('remove');
// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals)
$tpl->debug = 0;
// Include WB functions file
require_once(WB_PATH.'/framework/functions.php');
// Assign page filename for tracking with Google Analytics _trackPageview() function
global $ga_page;
$ga_page = '/view_pay_method.php';
// TITLE, CUSTOMERS MESSAGE AND TERMS & CONDITIONS
// ***********************************************
// Customers message
$display_cust_msg = $setting_cust_msg == 'show' ? 'table-row' : 'none';
$cust_msg = '';
if (!empty($_SESSION['bakery']['cust_msg'])) {
$cust_msg = htmlspecialchars($_SESSION['bakery']['cust_msg'], ENT_QUOTES);
}
// If tac url is set customers have to accept the terms & conditions
$display_agree = 'none';
$display_tac = 'none';
$tac_link = '<a href="'.$setting_tac_url.'" target="_blank">'.$MOD_BAKERY['TXT_AGREE'].' '.$setting_shop_name.'</a>';
if (!empty($setting_tac_url)) {
$display_agree = 'table-row';
$display_tac = 'block';
}
// No right of revocation when purchasing digital goods
$display_no_revocation = 'none';
if ($setting_no_revocation == 'e-goods') {
$display_agree = 'table-row';
$display_no_revocation = 'block';
}
// Show title, customers message and terms & conditions using template file
$tpl->set_file('pay_methods_title', 'title.htm');
$tpl->set_var(array(
'WB_URL' => WB_URL,
'SETTING_CONTINUE_URL' => $setting_continue_url,
'TXT_TAC_AND_PAY_METHOD' => $MOD_BAKERY['TXT_TAC_AND_PAY_METHOD'],
'DISPLAY_AGREE' => $display_agree,
'DISPLAY_TAC' => $display_tac,
'TXT_JS_AGREE' => $MOD_BAKERY['TXT_JS_AGREE'],
'TAC_LINK' => $tac_link,
'DISPLAY_NO_REVOCATION' => $display_no_revocation,
'TXT_NO_REVOCATION' => $MOD_BAKERY['TXT_FULL_WAIVER_OF_RIGHT_TO_REVOKE'],
'TXT_PAY_METHOD' => $MOD_BAKERY['TXT_SELECT_PAY_METHOD'],
'DISPLAY_CUST_MSG' => $display_cust_msg,
'TXT_ENTER_CUST_MSG' => $MOD_BAKERY['TXT_ENTER_CUST_MSG'],
'CUST_MSG' => $cust_msg
));
$tpl->pparse('output', 'pay_methods_title');
// DISPLAY LIST OF PAYMENT METHODS
// *******************************
// Only show payment method/payment gateway if we have to
if ($num_payment_methods > 0) {
foreach ($setting_payment_methods as $payment_method) {
if (is_file(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/gateway.php')) {
include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/gateway.php');
}
}
} else {
// Show payment methods error using template file
$tpl->set_file('pay_methods_error', 'error.htm');
$tpl->set_var(array(
'ERR_NO_PAYMENT_METHOD' => $MOD_BAKERY['ERR_NO_PAYMENT_METHOD']
));
$tpl->pparse('output', 'pay_methods_error');
}
// Show payment methods footer using template file
$tpl->set_file('pay_methods_footer', 'footer.htm');
$tpl->set_var(array(
'ERR_NO_PAYMENT_METHOD' => $MOD_BAKERY['ERR_NO_PAYMENT_METHOD']
));
$tpl->pparse('output', 'pay_methods_footer');