Payment Process giving JPath::check Snooping out of bounds @ JPATH_COMPONENT/vie

Started by lee-chilli, January 25, 2013, 11:23:08 AM

Previous topic - Next topic

lee-chilli

Hi,

I'm using cardsave on my website, this is a payment system and redirects like basic Paypal.
Once the details have been entered on the cardsave side it should then redirect back to the site however I get the following error

ERROR 13326: Couldn't speak to ServerResultURL [http://domain/index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component].
Full Error Details: The remote server returned an error: (500) Internal Server Error.

Error: 20 - JPath::check Snooping out of bounds @ JPATH_COMPONENT/views

The payment is still being shown on the Virtuemart side as complete.

Any help would be great

VM verison 2.0.18a
Joomla 2.5


lee-chilli


lee-chilli


lee-chilli

I've been in contact with the payment developer who has given the following statement.
It’s actually failing on one of the Joomla functions/commands not one created by CardSave

If anyone can help with this issue it would be great help.

Thanks

---
Update: This is really an issue I'm trying to resolve and would like any help what so ever in this matter

update: I've managed to narrow down the issue to the administrator/components/com_virtuemart/models/orders.php - updateStatusForOneOrder

update: After more tests I've narrowed it down to private function notifyCustomer($virtuemart_order_id, $newOrderData = 0 )

alatak

Hello

QuoteError: 20 - JPath::check Snooping out of bounds @ JPATH_COMPONENT/views
I had that error once...
If i remember correctly it was because some PATH definition were missing

lee-chilli

Quote from: alatak on March 20, 2013, 14:51:30 PM
Hello

QuoteError: 20 - JPath::check Snooping out of bounds @ JPATH_COMPONENT/views
I had that error once...
If i remember correctly it was because some PATH definition were missing

Seems there an error to do with sending the e-mail out once it's complete. Speaking with cardsave again to see if they can help resolve this issue

Cardsave are saying the issue is with the orders.php file from: administrator > components > com_virtuemart > models folder where the Path is not correct, but claiming they're not correct within VM.

I'm becoming more confused with this issue

alatak

Hello

QuoteError: 20 - JPath::check Snooping out of bounds @ JPATH_COMPONENT/views
this means that the constant JPATH_COMPONENT has not been defined.
If it is not defined, it means that the code has not included the correct files
I don't know that payment method, so exactly why this constant is not defined

lee-chilli

Quote from: alatak on March 20, 2013, 19:04:08 PM
Hello
this means that the constant JPATH_COMPONENT has not been defined.
If it is not defined, it means that the code has not included the correct files
I don't know that payment method, so exactly why this constant is not defined
Thanks for getting back to me, so by the sounds of it this means something hasn't been set up correctly with the plugin?

Edit --
Spoken with cardsave and provided them with the information you gave me and I was given the following reply

We have identified that the error is within this VM function.
All that is passed to the function is an order ID and true value. This then processes core VM code (which then calls other additional core VM functions) - this is where it is failing.

edit ---

It also seems Paypal has the same issue. I've tested it via the sandbox, the payment goes through completely however VM displays the order as pending (this is what it's set to be if the order is left as pending) However there 2 emails saying the payment is complete



lee-chilli

Hi,

I don't mean to double post but this issue is stopping payments on the site which is the main reason for the site being live, is there anyone able to help me with this issue?

Milbo

JPATH_COMPONENT is a constant of joomla. I think your link is missing the option=com_virtuemart, because this path is set in libraries/joomla/application/component

define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option);


and JPATH_BASE is

define('JPATH_BASE', dirname(__FILE__));

of course executed in the main directory. But I think the component virtuemart is not correctly loaded. It is also wrong to use the JPATH_COMPONENT shit, cause it is different for FE and BE. They should read here please http://dev.virtuemart.net/projects/virtuemart/wiki/Developing_a_module_or_plugin_for_VirtueMart_2

and use if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');

and then the constants JPATH_VM_SITE respectivly JPATH_VM_ADMINISTRATOR
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lee-chilli

Thanks for getting back to me.

I'm rather more confused as the link does have option=com_virtuemart as you can see from the top

I've added the code for the plugin here if it helps to trying to sort this

Thanks again to both of you for the support so far


if (!defined('_JEXEC'))
    die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');

if (!class_exists('vmPSPlugin'))
    require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php');
// Retrieve order ID from database
if (!class_exists('VirtueMartModelOrders')) {
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
}
$virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($cardsave_data['OrderID']);
if (!$virtuemart_order_id) {
JError::raiseNotice('OrderNotFound', 'StatusCode=30&Message=Order:+'.$cardsave_data['OrderID'].'+could+not+be+found');
return null; //order cannot be found
}

//pull out order info using ID
$order = VirtueMartModelOrders::getOrder($virtuemart_order_id);
$order_status_code = $order['items'][0]->order_status;

//check status returned by CardSave
if ($cardsave_data['StatusCode'] == 0) {
$new_status = "C"; //complete status
} else {
$new_status = "X"; //canceled/declined status
}

//check current status - so we don't update an order which has already been updated already
if ($order_status_code == 'P') {
// save order data

$modelOrder = new VirtueMartModelOrders();
$order['order_status'] = $new_status;
$order['virtuemart_order_id'] = $virtuemart_order_id;
$order['customer_notified'] = 1;
$date = JFactory::getDate();
$order['comments'] = $cardsave_data["Message"];

//update order with new status and success/failure message
$modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, true);

}

//If order payment successful, empty basket
if ($cardsave_data['StatusCode'] == 0) {
if (!class_exists('VirtueMartCart'))
require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php');
session_id($cardsave_data['return_context']);
session_start();
$cart = VirtueMartCart::getCart();
$cart->emptyCart();
}

JError::raiseNotice('ServerResultURLReturn', 'StatusCode=0');

return true;
}

function plgVmOnPaymentResponseReceived(&$html) {

$virtuemart_paymentmethod_id = JRequest::getInt('pm', 0);
$cardsave_data = JRequest::get('request');
$vendorId = 0;
if ($cardsave_data['module'] != "cardsave_redirect") {
return null; // Another method was selected, do nothing
}

if (!class_exists('VirtueMartCart'))
require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php');
if (!class_exists('shopFunctionsF'))
require(JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php');
if (!class_exists('VirtueMartModelOrders'))
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );

$virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($cardsave_data['OrderID']);
if (!$virtuemart_order_id) {
return null;
}

$order = VirtueMartModelOrders::getOrder($virtuemart_order_id);
//$order_status_code = $order['items'][0]->order_status;


$db = JFactory::getDBO();
$q = "SELECT * FROM #__virtuemart_orders WHERE virtuemart_order_id = " . $virtuemart_order_id;
$db->setQuery($q);
if (!($orderTable = $db->loadObject())) {
JError::raiseWarning(500, $db->getErrorMsg());
return '';
}

$order_status_code = $orderTable->order_status;

$historycount = count($order['history']);

$orderhistory = $order['history'][$historycount - 1];


Due to post limit I was only able to add the above which I'm hoping is enough information

alatak


lee-chilli



alatak

Hello
No. I look at the code. I saw some glintches but nothing that could explain this error message