I wrote a payment module for X-Cart.
My return url section is:
require './auth.php';
if (!func_is_active_payment('cc_mellat.php'))
exit;
$rescode=$_POST['ResCode'];
$RefID=$_POST['RefId'];
$saleOrderId=$_POST['saleOrderId'];
$SaleReferenceId=$_POST['SaleReferenceId'];
$tmp = func_query_first("SELECT sessionid,param1 FROM $sql_tbl[cc_pp3_data] WHERE ref='".$saleOrderId."'");
$bill_output['sessid'] = $tmp['sessionid'];
$bill_output['billmes']="RefId:".$RefId." - ResCode: ".$rescode." - SaleReferenceId:".$SaleReferenceId;
// Approved
if ($rescode == 0 && $is_md5) {
$bill_output['code'] = 1;
// Declined
} else {
echo "Error: ".$rescode;
$bill_output['code'] = 2;
}
var_dump($bill_output);
require($xcart_dir.'/payment/payment_ccend.php');
but after payment X-Cart says:
Order declined.
Review your data or contact the store administrator.
Reason: Error: Your order was lost
What is the problem?
It seems you use undefined variable $is_md5 here: