Payment has failed, please reload checkout page and try again. Your card has not been charged


ReferenceError: Ebizmarts SagePay Suite is not defined

I just played with the following code in /magento/app/code/local/Ebizmarts/SagePaySuite/Model/Observer/Sales.php

if(is_null($sessionVendor)){

$dbtrn = $this->_getTransactionsModel()->loadByParent($order->getId());
if(!$dbtrn->getId()){

#For empty payments or old orders (standalone payment methods).
if( (Mage::app()->getRequest()->getControllerModule() == ‘Mage_Api’) || Mage::registry(’current_shipment’) || Mage::registry(’sales_order’) || Mage::registry(’current_creditmemo’) || Mage::registry(’current_invoice’)){
return $o;
}

$logfileName = $order->getIncrementId() . ‘-’ . time() . ‘_Payment_Failed.log’;

$request_data = $_REQUEST;
if( isset($request_data[’payment’]) ){
$request_data[’payment’][’cc_number’] = ‘XXXXXXXXXXXXX’;
$request_data[’payment’][’cc_cid’] = ‘XXX’;
}

Sage_Log::log($order->getIncrementId(), null, $logfileName);
Sage_Log::log(Mage::helper(’core/http’)->getHttpUserAgent(false), null, $logfileName);
Sage_Log::log(print_r($request_data, true), null, $logfileName);
Sage_Log::log(’——————–’, null, $logfileName);

Mage::throwException(’Payment has failed, please reload checkout page and try again. Your card has not been charged.’);
}

return $o;
}

If I change the fist line from

if(is_null($sessionVendor)){

to

if(!is_null($sessionVendor)){

Payment is successful.
Enjoy

Advertisements

One thought on “Payment has failed, please reload checkout page and try again. Your card has not been charged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s