  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: payment.php 151 2005-08-02 14:33:25Z mattice $ |
| |
| 3 | + | $Id: payment.php 368 2005-12-22 16:27:23Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
15 | 15 | | |
| |
16 | 16 | | // class constructor |
| |
17 | 17 | | function payment($module = '') { |
  |
18 | | - | if (PHP_VERSION < 4.1) { |
| |
19 | | - | global $_SERVER; |
| |
20 | | - | } |
| |
21 | | - | |
| |
22 | | - | global $osC_Session; |
| |
23 | | - | |
|
24 | 18 | | if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) { |
| |
25 | 19 | | $this->modules = explode(';', MODULE_PAYMENT_INSTALLED); |
| |
26 | 20 | | |
| |
|
|
 |
… |
|
39 | 33 | | } |
| |
40 | 34 | | |
| |
41 | 35 | | for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) { |
  |
42 | | - | include(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/modules/payment/' . $include_modules[$i]['file']); |
| |
43 | | - | include(DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']); |
| |
| 36 | + | include('includes/languages/' . $_SESSION['language'] . '/modules/payment/' . $include_modules[$i]['file']); |
| |
| 37 | + | include('includes/modules/payment/' . $include_modules[$i]['file']); |
|
44 | 38 | | |
| |
45 | 39 | | $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']; |
| |
46 | 40 | | } |
| |
47 | 41 | | |
| |
48 | 42 | | // if there is only one payment method, select it as default because in |
| |
49 | 43 | | // checkout_confirmation.php the $payment variable is being assigned the |
| |
50 | 44 | | // $_POST['payment_mod_sel'] value which will be empty (no radio button selection possible) |
  |
51 | | - | if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$osC_Session->value('payment')]) || (isset($GLOBALS[$osC_Session->value('payment')]) && !is_object($GLOBALS[$osC_Session->value('payment')]))) ) { |
| |
52 | | - | $osC_Session->set('payment', $include_modules[0]['class']); |
| |
| 45 | + | if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$_SESSION['payment']]) || (isset($GLOBALS[$_SESSION['payment']]) && !is_object($GLOBALS[$_SESSION['payment']]))) ) { |
| |
| 46 | + | $_SESSION['payment'] = $include_modules[0]['class']; |
|
53 | 47 | | } |
| |
54 | 48 | | |
| |
55 | 49 | | if ( (tep_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) { |
| |
|
|
 |
… |
|
80 | 74 | | function javascript_validation() { |
| |
81 | 75 | | $js = ''; |
| |
82 | 76 | | if (is_array($this->modules)) { |
  |
83 | | - | $js = '<script language="javascript"><!-- ' . "\n" . |
| |
| 77 | + | $js = '<script type="text/javascript"><!-- ' . "\n" . |
  |
84 | 78 | | 'function check_form() {' . "\n" . |
| |
85 | 79 | | ' var error = 0;' . "\n" . |
| |
86 | 80 | | ' var error_message = "' . JS_ERROR . '";' . "\n" . |