[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/ext/modules/payment/worldpay/ -> junior_callback.php (source)

   1  <?php
   2  /*
   3    $Id: junior_callback.php 1807 2008-01-13 00:50:08Z user $
   4  
   5    osCMax Power E-Commerce
   6    http://oscdox.com
   7  
   8    Copyright 2008 osCMax
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    if (isset($HTTP_POST_VARS['M_sid']) && !empty($HTTP_POST_VARS['M_sid'])) {
  14      chdir('../../../../');
  15      require  ('includes/application_top.php');
  16  
  17      if ($HTTP_POST_VARS['transStatus'] == 'Y') {
  18        $pass = false;
  19  
  20        if (isset($HTTP_POST_VARS['M_hash']) && !empty($HTTP_POST_VARS['M_hash']) && ($HTTP_POST_VARS['M_hash'] == md5($HTTP_POST_VARS['M_sid'] . $HTTP_POST_VARS['M_cid'] . $HTTP_POST_VARS['cartId'] . $HTTP_POST_VARS['M_lang'] . number_format($HTTP_POST_VARS['amount'], 2) . MODULE_PAYMENT_WORLDPAY_JUNIOR_MD5_PASSWORD))) {
  21          $pass = true;
  22        }
  23  
  24        if (isset($HTTP_POST_VARS['callbackPW']) && ($HTTP_POST_VARS['callbackPW'] != MODULE_PAYMENT_WORLDPAY_JUNIOR_CALLBACK_PASSWORD)) {
  25          $pass = false;
  26        }
  27  
  28        if (tep_not_null(MODULE_PAYMENT_WORLDPAY_JUNIOR_CALLBACK_PASSWORD) && !isset($HTTP_POST_VARS['callbackPW'])) {
  29          $pass = false;
  30        }
  31  
  32        if ($pass == true) {
  33          include('includes/languages/' . basename($HTTP_POST_VARS['M_lang']) . '/modules/payment/worldpay_junior.php');
  34  
  35          $order_query = tep_db_query("select orders_status, currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . (int)$HTTP_POST_VARS['cartId'] . "' and customers_id = '" . (int)$HTTP_POST_VARS['M_cid'] . "'");
  36          if (tep_db_num_rows($order_query) > 0) {
  37            $order = tep_db_fetch_array($order_query);
  38  
  39            if ($order['orders_status'] == MODULE_PAYMENT_WORLDPAY_JUNIOR_PREPARE_ORDER_STATUS_ID) {
  40              $order_status_id = (MODULE_PAYMENT_WORLDPAY_JUNIOR_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_WORLDPAY_JUNIOR_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID);
  41  
  42              tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$HTTP_POST_VARS['cartId'] . "'");
  43  
  44              $sql_data_array = array('orders_id' => $HTTP_POST_VARS['cartId'],
  45                                      'orders_status_id' => $order_status_id,
  46                                      'date_added' => 'now()',
  47                                      'customer_notified' => '0',
  48                                      'comments' => 'WorldPay: Transaction Verified');
  49  
  50              tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
  51  
  52              if (MODULE_PAYMENT_WORLDPAY_JUNIOR_TESTMODE == 'True') {
  53                $sql_data_array = array('orders_id' => $HTTP_POST_VARS['cartId'],
  54                                        'orders_status_id' => $order_status_id,
  55                                        'date_added' => 'now()',
  56                                        'customer_notified' => '0',
  57                                        'comments' => MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_WARNING_DEMO_MODE);
  58  
  59                tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
  60              }
  61  ?>
  62  <style>
  63  .pageHeading {
  64    font-family: Verdana, Arial, sans-serif;
  65    font-size: 20px;
  66    font-weight: bold;
  67    color: #9a9a9a;
  68  }
  69  
  70  .main {
  71    font-family: Verdana, Arial, sans-serif;
  72    font-size: 11px;
  73    line-height: 1.5;
  74  }
  75  </style>
  76  
  77  <p class="pageHeading"><?php echo STORE_NAME; ?></p>
  78  
  79  <p class="main" align="center"><?php echo MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_SUCCESSFUL_TRANSACTION; ?></p>
  80  
  81  <p align="center"><input type="button" value="<?php echo sprintf(MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_CONTINUE_BUTTON, addslashes(STORE_NAME)); ?>" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CHECKOUT_PROCESS, tep_session_name() . '=' . $HTTP_POST_VARS['M_sid'] . '&hash=' . $HTTP_POST_VARS['hash'], 'SSL', false); ?>';"></p>
  82  
  83  <p>&nbsp;</p>
  84  
  85  <WPDISPLAY ITEM=banner>
  86  <?php
  87            }
  88          }
  89        }
  90      }
  91    }
  92  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7