Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Mon, Jan 6, 5:31 AM

in-commerce

Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_notify.php (revision 14689)
@@ -1,51 +1,51 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$sql = 'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = "kGWGoogleCheckout"';
$payment_type_id = $application->Conn->GetOne($sql);
$application->SetVar('payment_type_id', $payment_type_id); // keep, because kGWGoogleCheckout::processNewOrderNotification relies on this
$order =& $application->recallObject('ord', null, Array ('skip_autoload' => true));
/* @var $order OrdersItem */
$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'] );
$transaction_status = $gateway_object->processNotification($gw_data['gw_params']);
$sql = 'UPDATE '.$order->TableName.'
SET TransactionStatus = '.$transaction_status.'
WHERE '.$order->IDField.' = '.$order->GetID();
$application->Conn->Query($sql);
$order->SetDBField('TransactionStatus', $transaction_status);
if ($transaction_status == 1) {
$dummy_var = '10';
$application->SetVar('ord_id', $order->GetID()); // used in OrdersEventHandler::UpdateOrderItem
$application->HandleEvent($dummy_var, 'ord:OnCompleteOrder');
}
$application->Done();
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_error.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_error.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_error.php (revision 14689)
@@ -1,31 +1,31 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('sella_error', 1);
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_ok.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_ok.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_ok.php (revision 14689)
@@ -1,31 +1,31 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('sella_ok', 1);
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/paybox_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/paybox_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/paybox_notify.php (revision 14689)
@@ -1,30 +1,29 @@
<?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('ADMIN', 1);
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');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kPayboxGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/multicards_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/multicards_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/multicards_notify.php (revision 14689)
@@ -1,30 +1,29 @@
<?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('ADMIN', 1);
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');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kMultiCardsGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/verisign_pflink_notify.php (revision 14689)
@@ -1,29 +1,29 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kVerisignPfLinkGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/google_checkout_shippings.php (revision 14689)
@@ -1,37 +1,37 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$sql = 'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = "kGWGoogleCheckout"';
$payment_type_id = $application->Conn->GetOne($sql);
$order =& $application->recallObject('ord', null, Array ('skip_autoload' => true));
/* @var $order OrdersItem */
$gw_data = $order->getGatewayData($payment_type_id);
$application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] );
$gateway_object =& $application->recallObject( $gw_data['ClassName'] );
/* @var $gateway_object kGWGoogleCheckout */
$gateway_object->processNotification($gw_data['gw_params'], 'shippings');
$application->Done();
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/atosorigin_notify.php (revision 14689)
@@ -1,29 +1,29 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH . '/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kAtosOriginGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_notify.php
===================================================================
--- branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_notify.php (revision 14688)
+++ branches/5.2.x/units/gateways/gw_classes/notify_scripts/sella_notify.php (revision 14689)
@@ -1,29 +1,29 @@
<?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__) . '/../../../../../..'));
- define('REL_PATH', 'modules/in-commerce/units/gateways/gw_classes/notify_scripts');
define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../../../../../..'));
+
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->SetVar('payment_type_id',
$application->Conn->GetOne(
'SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes AS pt
LEFT JOIN '.TABLE_PREFIX.'Gateways AS g
ON g.GatewayId = pt.GatewayId
WHERE g.ClassName = '.$application->Conn->qstr('kSellaGuestPayGW')));
include(MODULES_PATH.'/in-commerce/gw_notify.php');
\ No newline at end of file
Index: branches/5.2.x/gw_notify.php
===================================================================
--- branches/5.2.x/gw_notify.php (revision 14688)
+++ branches/5.2.x/gw_notify.php (revision 14689)
@@ -1,65 +1,64 @@
<?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('GW_NOTIFY', 1);
- 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();
// for debugging payment gateway notifications, don't remove
/*$fh = fopen((defined('RESTRICTED') ? RESTRICTED : 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'] );
$transaction_status = $gateway_object->processNotification($gw_data['gw_params']);
$sql = 'UPDATE %s SET GWResult1 = %s WHERE %s = %s';
$sql = sprintf($sql, $order->TableName, $db->qstr($gateway_object->getGWResponce()), $order->IDField, $order->GetID() );
$db->Query($sql);
$order->SetDBField('GWResult1', $gateway_object->getGWResponce() );
$sql = 'UPDATE %s SET TransactionStatus = %s WHERE %s = %s';
$db->Query( sprintf($sql, $order->TableName, $transaction_status, $order->IDField, $order->GetID()) );
$order->SetDBField('TransactionStatus', $transaction_status);
if($transaction_status == 1)
{
$dummy_var = '10';
$application->HandleEvent($dummy_var, 'ord:OnCompleteOrder');
}
else {
$application->StoreVar('gw_error', $gateway_object->getErrorMsg());
}
$application->Done();
\ No newline at end of file
Index: branches/5.2.x/install.php
===================================================================
--- branches/5.2.x/install.php (revision 14688)
+++ branches/5.2.x/install.php (revision 14689)
@@ -1,53 +1,52 @@
<?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.
*/
$module_folder = 'modules/in-commerce';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
- define('REL_PATH', $module_folder);
define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
$toolkit = new kInstallToolkit();
}
else {
// install, using installation wizard
$toolkit =& $this->toolkit;
/* @var $toolkit kInstallToolkit */
}
$application =& kApplication::Instance();
$application->Init();
if ($application->RecallVar('user_id') != USER_ROOT) {
die('restricted access!');
}
$category =& $toolkit->createModuleCategory('Products', 'Product Catalog', '#in-commerce/section_design#', 'in-commerce/img/menu_products.gif');
$toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{ProductCatId}', $category->GetID());
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
$toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
$toolkit->linkCustomFields(basename($module_folder), 'p', 11); // to create Custom Fields for Products
$toolkit->linkCustomFields('KERNEL', 'u', 6); // to create shipping related Custom Fields for Users
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'p', '#in-commerce/item_design#');
$toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file

Event Timeline