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, "\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 = ' '.$shipping_xml.' 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; }