73 lines
2.4 KiB
PHP
73 lines
2.4 KiB
PHP
<?php
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| CubeCart 4
|
|
| ========================================
|
|
| CubeCart is a registered trade mark of Devellion Limited
|
|
| Copyright Devellion Limited 2006. All rights reserved.
|
|
| Devellion Limited,
|
|
| 5 Bridge Street,
|
|
| Bishops Stortford,
|
|
| HERTFORDSHIRE.
|
|
| CM23 2JU
|
|
| UNITED KINGDOM
|
|
| http://www.devellion.com
|
|
| UK Private Limited Company No. 5323904
|
|
| ========================================
|
|
| Web: http://www.cubecart.com
|
|
| Email: info (at) cubecart (dot) com
|
|
| License Type: CubeCart is NOT Open Source Software and Limitations Apply
|
|
| Licence Info: http://www.cubecart.com/site/faq/license.php
|
|
+--------------------------------------------------------------------------
|
|
| remote.inc.php
|
|
| ========================================
|
|
| Manages remote calls from 3rd party servers
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
if (!defined('CC_INI_SET')) die("Access Denied");
|
|
|
|
## START MAIN CONTENT
|
|
if ($_REQUEST['type']=="gateway" || $_REQUEST['type']=="altCheckout") {
|
|
## make sure module is enabled
|
|
if (isset($_REQUEST['module'])) {
|
|
$query = "SELECT folder FROM ".$glob['dbprefix']."CubeCart_Modules WHERE module=".$db->mySQLSafe($_REQUEST['type'])." AND folder=".$db->mySQLSafe($_REQUEST['module'])." AND status = 1";
|
|
$gatewayStatus = $db->select($query);
|
|
}
|
|
if(!$gatewayStatus) exit;
|
|
|
|
$modulePath = "modules".CC_DS.$_REQUEST['type'].CC_DS.sanitizeVar($_REQUEST['module']).CC_DS;
|
|
|
|
$module = fetchDbConfig($gatewayStatus[0]['folder']);
|
|
|
|
switch(sanitizeVar($_REQUEST['cmd'])) {
|
|
## Payment Gateway Callbacks
|
|
case "call":
|
|
$moduleFullPath = $modulePath."call.inc.php";
|
|
break;
|
|
## Process Payment
|
|
case "process":
|
|
$moduleFullPath = $modulePath."process.inc.php";
|
|
break;
|
|
}
|
|
|
|
if (file_exists($moduleFullPath)) {
|
|
require_once "classes".CC_DS."cart".CC_DS."order.php";
|
|
$order = new order();
|
|
include_once $moduleFullPath;
|
|
} else {
|
|
die("Module path doesn't exist!");
|
|
}
|
|
}
|
|
|
|
# Worldpay fix
|
|
#if ($_REQUEST['cmd'] == "process" && $_REQUEST['module'] != "WorldPay") {
|
|
if ($_REQUEST['cmd'] == "process") {
|
|
/*
|
|
1 = Payment Failed link to try again
|
|
2 = Payment successful and complete
|
|
3 = Payment may or may not have been approved yet
|
|
*/
|
|
if (!isset($paymentResult)) $paymentResult = "3";
|
|
httpredir("index.php?_g=co&_a=confirmed&s=".$paymentResult);
|
|
}
|
|
?>
|