Attached Files |
incorrect_modules_paths_defined.patch [^] (18,690 bytes) 2010-06-08 22:39
[Show Content]
Index: in-auction/cron.php
===================================================================
--- in-auction/cron.php (revision 13682)
+++ in-auction/cron.php (working copy)
@@ -14,7 +14,7 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-auction/generate_keys.php
===================================================================
--- in-auction/generate_keys.php (revision 13682)
+++ in-auction/generate_keys.php (working copy)
@@ -13,8 +13,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('REL_PATH', '/in-auction');
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-auction/hitcounter.php
===================================================================
--- in-auction/hitcounter.php (revision 13682)
+++ in-auction/hitcounter.php (working copy)
@@ -13,7 +13,7 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-auction/new_token_accept.php
===================================================================
--- in-auction/new_token_accept.php (revision 13682)
+++ in-auction/new_token_accept.php (working copy)
@@ -13,7 +13,7 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-auction/new_token_reject.php
===================================================================
--- in-auction/new_token_reject.php (revision 13682)
+++ in-auction/new_token_reject.php (working copy)
@@ -13,7 +13,7 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-auction/notify.php
===================================================================
--- in-auction/notify.php (revision 13682)
+++ in-auction/notify.php (working copy)
@@ -14,7 +14,7 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: in-commerce/add_to_cart.php
===================================================================
--- in-commerce/add_to_cart.php (revision 13682)
+++ in-commerce/add_to_cart.php (working copy)
@@ -11,7 +11,7 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
-define('FULL_PATH', realpath(dirname(__FILE__)));
+define('FULL_PATH', realpath(dirname(__FILE__) . '/../..'));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
Index: in-commerce/gw_notify.php
===================================================================
--- in-commerce/gw_notify.php (revision 13682)
+++ in-commerce/gw_notify.php (working copy)
@@ -10,32 +10,24 @@
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
-
- define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('GW_NOTIFY', 1);
- define('REL_PATH', 'in-commerce');
- include_once(FULL_PATH.'/core/kernel/startup.php');
-
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..'));
+ define('REL_PATH', 'modules/in-commerce');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
+
$application =& kApplication::Instance();
$application->Init();
-
- /*$fh = fopen(WRITEABLE . '/gw.log', 'a');
- fwrite ($fh, "\n\n".date('d/m/y h:i:s').":\n");
- foreach ($_REQUEST as $key => $val) {
- fwrite($fh, "<input type=\"text\" name=\"$key\" value=\"$val\">\n");
- }
- fclose($fh);*/
-
+
$db =& $application->GetADODBConnection();
$application->setUnitOption('ord','AutoLoad',false);
$order =& $application->recallObject('ord');
-
+
$order_id = $application->GetVar('order_id');
if ($order_id) {
$order->Load($order_id);
}
-
+
$gw_data = $order->getGatewayData($application->GetVar('payment_type_id'));
$application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] );
$gateway_object =& $application->recallObject( $gw_data['ClassName'] );
@@ -60,4 +52,4 @@
$application->StoreVar('gw_error', $gateway_object->getErrorMsg());
}
- $application->Done();
\ No newline at end of file
+ $application->Done();s
\ No newline at end of file
Index: in-commerce/units/gateways/gw_classes/atosorigin.php
===================================================================
--- in-commerce/units/gateways/gw_classes/atosorigin.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/atosorigin.php (working copy)
@@ -63,8 +63,11 @@
$params['normal_return_url'] = $this->Application->HREF($tag_params['return_template'],'',Array('pass'=>'m'));
$params['cancel_return_url'] = $this->Application->HREF($tag_params['cancel_template'],'',Array('pass'=>'m'));
- $params['automatic_response_url'] = $this->Application->BaseURL('/in-commerce/units/gateways/gw_classes/notify_scripts').'atosorigin_notify.php';
-
+
+ $notify_script = MODULES_PATH . '/in-commerce/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php';
+ $notify_script = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL(), $notify_script);
+ $params['automatic_response_url'] = $notify_script;
+
$txt_amount = sprintf("%.2f", $item_data['TotalAmount']);
$params['amount'] = str_replace( Array('.', ','), '', $txt_amount);
Index: in-commerce/units/gateways/gw_classes/google_checkout.php
===================================================================
--- in-commerce/units/gateways/gw_classes/google_checkout.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/google_checkout.php (working copy)
@@ -108,7 +108,11 @@
}
$use_ssl = substr($this->gwParams['submit_url'], 0, 8) == 'https://' ? true : null;
- $shipping_url = $this->Application->BaseURL('/in-commerce/units/gateways/gw_classes/notify_scripts', $use_ssl).'google_checkout_shippings.php';
+
+ $notify_script = MODULES_PATH . '/in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php';
+ $notify_script = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL('', $use_ssl), $notify_script);
+
+ $shipping_url = $notify_script;
$shipping_xml = '<merchant-checkout-flow-support>
<shipping-methods>'.$shipping_xml.'</shipping-methods>
Index: in-commerce/units/gateways/gw_classes/ideal_nl.php
===================================================================
--- in-commerce/units/gateways/gw_classes/ideal_nl.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/ideal_nl.php (working copy)
@@ -81,8 +81,11 @@
$fields['bank_id'] = $this->Application->GetVar('ideal_nl_bank_id');
$fields['description'] = 'Invoice #'.$item_data['OrderNumber'];
- $fields['returnurl'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?order_id='.$item_data['OrderId'];
- $fields['reporturl'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?mode=report&order_id='.$item_data['OrderId'];
+ $notify_script = MODULES_PATH . '/in-commerce/gw_notify.php';
+ $notify_script = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL(), $notify_script);
+
+ $fields['returnurl'] = $notify_script . '?order_id='.$item_data['OrderId'];
+ $fields['reporturl'] = $notify_script . '?mode=report&order_id='.$item_data['OrderId'];
$transaction_xml = curl_post($gw_params['request_url'], $fields, null, 'GET');
Index: in-commerce/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
Index: in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: in-commerce/units/gateways/gw_classes/notify_scripts/multicards_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/multicards_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/multicards_notify.php (working copy)
@@ -11,13 +11,13 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
- if (!file_exists(FULL_PATH.'/core/kernel/application.php')) { //way to dectect new ver
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
+ if (!file_exists(FULL_PATH . '/core/kernel/application.php')) { //way to dectect new ver
define('APPLICATION_CLASS', 'MyApplication');
}
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: in-commerce/units/gateways/gw_classes/notify_scripts/paybox_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/paybox_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/paybox_notify.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
if (!file_exists(FULL_PATH.'/core/kernel/application.php')) { //way to dectect new ver
define('APPLICATION_CLASS', 'MyApplication');
}
Index: in-commerce/units/gateways/gw_classes/notify_scripts/sella_error.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/sella_error.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/sella_error.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
Index: in-commerce/units/gateways/gw_classes/notify_scripts/sella_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/sella_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/sella_notify.php (working copy)
@@ -12,7 +12,7 @@
*/
define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
Index: in-commerce/units/gateways/gw_classes/notify_scripts/sella_ok.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/sella_ok.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/sella_ok.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: in-commerce/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php
===================================================================
--- in-commerce/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: in-commerce/units/gateways/gw_classes/paypal.php
===================================================================
--- in-commerce/units/gateways/gw_classes/paypal.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/paypal.php (working copy)
@@ -85,7 +85,11 @@
/* @var $cs_helper kCountryStatesHelper */
$ret['country'] = $cs_helper->getCountryIso( $item_data['BillingCountry'] );
- $ret['notify_url'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
+
+ $notify_script = MODULES_PATH . '/in-commerce/gw_notify.php';
+ $notify_script = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL(), $notify_script);
+ $ret['notify_url'] = $notify_script . '?sid=' . $this->Application->GetSID() . '&admin=1&order_id=' . $item_data['OrderId'];
+
$ret['cmd'] = '_xclick'; // act as "Buy Now" PayPal button
return $ret;
}
Index: in-commerce/units/gateways/gw_classes/worldpay.php
===================================================================
--- in-commerce/units/gateways/gw_classes/worldpay.php (revision 13682)
+++ in-commerce/units/gateways/gw_classes/worldpay.php (working copy)
@@ -87,7 +87,10 @@
$ret['MC_return_page'] = $this->Application->HREF($tag_params['return_template'], '', $return_params);
$ret['MC_cancel_return_page'] = $this->Application->HREF($tag_params['cancel_template'], '', $return_params);
- $ret['MC_callback'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
+ $notify_script = MODULES_PATH . '/in-commerce/gw_notify.php';
+ $notify_script = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL(), $notify_script);
+ $ret['MC_callback'] = $notify_script . '?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
+
return $ret;
}
path_fixes_in_auction_v2.patch [^] (3,217 bytes) 2010-06-09 04:11
[Show Content]
Index: cron.php
===================================================================
--- cron.php (revision 13576)
+++ cron.php (working copy)
@@ -14,7 +14,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: generate_keys.php
===================================================================
--- generate_keys.php (revision 13557)
+++ generate_keys.php (working copy)
@@ -13,8 +13,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('REL_PATH', '/in-auction');
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: hitcounter.php
===================================================================
--- hitcounter.php (revision 13576)
+++ hitcounter.php (working copy)
@@ -13,7 +13,9 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('DBG_SKIP_REPORTING', 1);
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
@@ -25,9 +27,8 @@
$application->StoreVar('user_id', USER_ROOT);
-
$application->HandleEvent($event, 'l-ebay:OnHitAuction');
- $filename=FULL_PATH.'/in-auction/admin_templates/img/s.gif';
+ $filename = MODULES_PATH . '/in-auction/admin_templates/img/s.gif';
header('Content-type: image/gif');
header('Content-length: '.filesize($filename));
readfile($filename);
Index: new_token_accept.php
===================================================================
--- new_token_accept.php (revision 13576)
+++ new_token_accept.php (working copy)
@@ -13,7 +13,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: new_token_reject.php
===================================================================
--- new_token_reject.php (revision 13576)
+++ new_token_reject.php (working copy)
@@ -13,7 +13,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
Index: notify.php
===================================================================
--- notify.php (revision 13576)
+++ notify.php (working copy)
@@ -14,7 +14,8 @@
$start = getmicrotime();
define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
+ define('REL_PATH', 'modules/in-auction');
+ define('FULL_PATH', realpath(dirname(__FILE__).'/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
path_fixes_in_commerce_v2.patch [^] (20,054 bytes) 2010-06-09 05:02
[Show Content]
Index: add_to_cart.php
===================================================================
--- add_to_cart.php (revision 13557)
+++ add_to_cart.php (working copy)
@@ -1,20 +0,0 @@
-<?php
-/**
-* @version $Id$
-* @package In-Commerce
-* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
-* @license Commercial License
-* This software is protected by copyright law and international treaties.
-* Unauthorized reproduction or unlicensed usage of the code of this program,
-* or any portion of it may result in severe civil and criminal penalties,
-* and will be prosecuted to the maximum extent possible under the law
-* See http://www.in-portal.org/commercial-license for copyright notices and details.
-*/
-
-define('FULL_PATH', realpath(dirname(__FILE__)));
-include_once(FULL_PATH.'/core/kernel/startup.php');
-
-$application =& kApplication::Instance();
-$application->Init();
-
-$application->Redirect('in-commerce/checkout/shop_cart', array('pass'=>'p,ord', 'ord_event' => 'OnAddToCart', 'p_id' => $application->GetVar('product')));
\ No newline at end of file
Index: gw_notify.php
===================================================================
--- gw_notify.php (revision 13557)
+++ gw_notify.php (working copy)
@@ -10,32 +10,34 @@
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
-
- define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
define('GW_NOTIFY', 1);
- define('REL_PATH', 'in-commerce');
- include_once(FULL_PATH.'/core/kernel/startup.php');
-
+ define('REL_PATH', 'modules/in-commerce');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..'));
+ include_once(FULL_PATH . '/core/kernel/startup.php');
+
$application =& kApplication::Instance();
$application->Init();
- /*$fh = fopen(WRITEABLE . '/gw.log', 'a');
+ /*
+ // for debugging payment gateway notifications, don't remove
+ $fh = fopen(WRITEABLE . '/gw.log', 'a');
fwrite ($fh, "\n\n".date('d/m/y h:i:s').":\n");
foreach ($_REQUEST as $key => $val) {
fwrite($fh, "<input type=\"text\" name=\"$key\" value=\"$val\">\n");
}
- fclose($fh);*/
-
+ fclose($fh);
+ */
+
$db =& $application->GetADODBConnection();
$application->setUnitOption('ord','AutoLoad',false);
$order =& $application->recallObject('ord');
-
+
$order_id = $application->GetVar('order_id');
if ($order_id) {
$order->Load($order_id);
}
-
+
$gw_data = $order->getGatewayData($application->GetVar('payment_type_id'));
$application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] );
$gateway_object =& $application->recallObject( $gw_data['ClassName'] );
Index: units/gateways/gw_classes/atosorigin.php
===================================================================
--- units/gateways/gw_classes/atosorigin.php (revision 13557)
+++ units/gateways/gw_classes/atosorigin.php (working copy)
@@ -63,10 +63,10 @@
$params['normal_return_url'] = $this->Application->HREF($tag_params['return_template'],'',Array('pass'=>'m'));
$params['cancel_return_url'] = $this->Application->HREF($tag_params['cancel_template'],'',Array('pass'=>'m'));
- $params['automatic_response_url'] = $this->Application->BaseURL('/in-commerce/units/gateways/gw_classes/notify_scripts').'atosorigin_notify.php';
+ $params['automatic_response_url'] = $this->getNotificationUrl('units/gateways/gw_classes/notify_scripts/atosorigin_notify.php');
$txt_amount = sprintf("%.2f", $item_data['TotalAmount']);
-
+
$params['amount'] = str_replace( Array('.', ','), '', $txt_amount);
$params['caddie'] = $this->Application->GetSID() . ',' . MD5($item_data['OrderId']);
$params['order_id'] = $item_data['OrderId'];
Index: units/gateways/gw_classes/google_checkout.php
===================================================================
--- units/gateways/gw_classes/google_checkout.php (revision 13557)
+++ units/gateways/gw_classes/google_checkout.php (working copy)
@@ -108,7 +108,7 @@
}
$use_ssl = substr($this->gwParams['submit_url'], 0, 8) == 'https://' ? true : null;
- $shipping_url = $this->Application->BaseURL('/in-commerce/units/gateways/gw_classes/notify_scripts', $use_ssl).'google_checkout_shippings.php';
+ $shipping_url = $this->getNotificationUrl('units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php', $use_ssl);
$shipping_xml = '<merchant-checkout-flow-support>
<shipping-methods>'.$shipping_xml.'</shipping-methods>
Index: units/gateways/gw_classes/gw_base.php
===================================================================
--- units/gateways/gw_classes/gw_base.php (revision 13557)
+++ units/gateways/gw_classes/gw_base.php (working copy)
@@ -258,4 +258,13 @@
return array();
}
+ function getNotificationUrl($script = 'gw_notify.php', $use_ssl = null)
+ {
+ // custom path can be: units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php'
+
+ $ret = MODULES_PATH . '/in-commerce/' . $script;
+ $ret = preg_replace('/^' . preg_quote(FULL_PATH . '/', '/') . '/', $this->Application->BaseURL('', $use_ssl), $ret);
+
+ return str_replace(DIRECTORY_SEPARATOR, '/', $ret);
+ }
}
\ No newline at end of file
Index: units/gateways/gw_classes/ideal_nl.php
===================================================================
--- units/gateways/gw_classes/ideal_nl.php (revision 13557)
+++ units/gateways/gw_classes/ideal_nl.php (working copy)
@@ -77,13 +77,12 @@
$fields['a'] = 'fetch';
$fields['partnerid'] = $gw_params['partner_id'];
$txt_amount = sprintf("%.2f", $item_data['TotalAmount']);
- $fields['amount'] = str_replace( Array('.', ','), '', $txt_amount);
+ $fields['amount'] = str_replace( Array('.', ','), '', $txt_amount);
$fields['bank_id'] = $this->Application->GetVar('ideal_nl_bank_id');
$fields['description'] = 'Invoice #'.$item_data['OrderNumber'];
+ $fields['returnurl'] = $this->getNotificationUrl() . '?order_id='.$item_data['OrderId'];
+ $fields['reporturl'] = $this->getNotificationUrl() . '?mode=report&order_id='.$item_data['OrderId'];
- $fields['returnurl'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?order_id='.$item_data['OrderId'];
- $fields['reporturl'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?mode=report&order_id='.$item_data['OrderId'];
-
$transaction_xml = curl_post($gw_params['request_url'], $fields, null, 'GET');
$parser =& $this->Application->recallObject('kXMLHelper');
Index: units/gateways/gw_classes/multicards.php
===================================================================
--- units/gateways/gw_classes/multicards.php (revision 13557)
+++ units/gateways/gw_classes/multicards.php (working copy)
@@ -65,7 +65,7 @@
// $ret['cancel_return'] = $this->Application->HREF($tag_params['cancel_template'],'',Array('pass'=>'m'));
// $ret['return'] = $this->Application->HREF($tag_params['return_template'],'',Array('pass'=>'m'));
-// $ret['notify_url'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
+// $ret['notify_url'] = $this->getNotificationUrl() . '?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
// $ret['cmd'] = '_xclick'; // act as "Buy Now" PayPal button
$ret['no_note'] = 1; // customer is not prompted for notes
Index: units/gateways/gw_classes/notify_scripts/atosorigin_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
@@ -26,4 +26,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kAtosOriginGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/google_checkout_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
Index: units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
Index: units/gateways/gw_classes/notify_scripts/multicards_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/multicards_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/multicards_notify.php (working copy)
@@ -11,13 +11,11 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
- if (!file_exists(FULL_PATH.'/core/kernel/application.php')) { //way to dectect new ver
- define('APPLICATION_CLASS', 'MyApplication');
- }
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
+
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
@@ -29,4 +27,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kMultiCardsGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/paybox_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/paybox_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/paybox_notify.php (working copy)
@@ -11,11 +11,9 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
- if (!file_exists(FULL_PATH.'/core/kernel/application.php')) { //way to dectect new ver
- define('APPLICATION_CLASS', 'MyApplication');
- }
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
+
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
@@ -29,4 +27,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kPayboxGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/sella_error.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/sella_error.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/sella_error.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
@@ -28,4 +28,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/sella_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/sella_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/sella_notify.php (working copy)
@@ -11,8 +11,8 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
include_once(FULL_PATH.'/core/kernel/startup.php');
@@ -26,4 +26,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/sella_ok.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/sella_ok.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/sella_ok.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
@@ -28,4 +28,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php
===================================================================
--- units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (revision 13557)
+++ units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (working copy)
@@ -11,10 +11,10 @@
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- define('FULL_PATH', realpath(dirname(__FILE__).'/../../../../../'));
- define('REL_PATH', 'in-commerce/units/gateways/gw_classes/notify_scripts');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+ define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
- include_once(FULL_PATH.'/core/kernel/startup.php');
+ include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
@@ -26,4 +26,4 @@
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kVerisignPfLinkGW')));
- include(FULL_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
+ include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: units/gateways/gw_classes/paypal.php
===================================================================
--- units/gateways/gw_classes/paypal.php (revision 13557)
+++ units/gateways/gw_classes/paypal.php (working copy)
@@ -85,7 +85,8 @@
/* @var $cs_helper kCountryStatesHelper */
$ret['country'] = $cs_helper->getCountryIso( $item_data['BillingCountry'] );
- $ret['notify_url'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
+ $ret['notify_url'] = $this->getNotificationUrl() . '?sid=' . $this->Application->GetSID() . '&admin=1&order_id=' . $item_data['OrderId'];
+
$ret['cmd'] = '_xclick'; // act as "Buy Now" PayPal button
return $ret;
}
@@ -149,7 +150,7 @@
/* @var $cs_helper kCountryStatesHelper */
$ret['country'] = $cs_helper->getCountryIso( $item_data['BillingCountry'] );
- $ret['notify_url'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'].'&payment_type_id='.$tag_params['payment_type_id'];
+ $ret['notify_url'] = $this->getNotificationUrl() . '?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'].'&payment_type_id='.$tag_params['payment_type_id'];
$ret['cmd'] = '_xclick-subscriptions'; // act as "Buy Now" PayPal button
$real_ret = array();
Index: units/gateways/gw_classes/worldpay.php
===================================================================
--- units/gateways/gw_classes/worldpay.php (revision 13557)
+++ units/gateways/gw_classes/worldpay.php (working copy)
@@ -86,8 +86,8 @@
$return_params = Array ('pass' => 'm', 'sid' => $this->Application->GetSID(), 'admin' => 1);
$ret['MC_return_page'] = $this->Application->HREF($tag_params['return_template'], '', $return_params);
$ret['MC_cancel_return_page'] = $this->Application->HREF($tag_params['cancel_template'], '', $return_params);
+ $ret['MC_callback'] = $this->getNotificationUrl() . '?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
- $ret['MC_callback'] = $this->Application->BaseURL('/in-commerce').'gw_notify.php?sid='.$this->Application->GetSID().'&admin=1&order_id='.$item_data['OrderId'];
return $ret;
}
|