I am trying to accept payments on x-cart script running on my website. For some reason, even after applying correct payment processing details. Xcart does not transact credit cards. :
Here is the script, my site is using to transact credit cards on 2checkout
#
$Id: cc_2checkoutcom.php,v 1.26.2.2 2004/08/19 05:52:43 max Exp $
#
if (!isset($REQUEST_METHOD))
$REQUEST_METHOD = $HTTP_SERVER_VARS["REQUEST_METHOD"];
if ($REQUEST_METHOD == "POST" && $HTTP_POST_VARS["x_response_code"] && $HTTP_POST_VARS["x_2checked"]=="Y")
{
include("../top.inc.php");
include($xcart_dir."/config.php");
$bill_output["sessid"] = array_pop(func_query_first("select sessionid from $sql_tbl[cc_pp3_data] where ref='".$HTTP_POST_VARS["x_invoice_num"]."'"));
$s = func_query_first("select param01,param03 from $sql_tbl[ccprocessors] where processor='cc_2checkoutcom.php'");
#x_response_code 1
#x_response_subcode 1
#x_response_reason_code 1
#x_auth_code 123456
#x_avs_code P
#x_trans_id 29378-1382296
$bill_output["code"] = ($x_response_code==1 ? 1 : 2);
if(strtoupper(md5($s["param03"].$s["param01"].$x_trans_id.$x_amount))!=$x_MD5_Hash)
{
$bill_output["code"] = 2;
$bill_output["billmes"] = "MD5 HASH is invalid!";
}
else $bill_output["billmes"] = "";
if(!empty($x_auth_code)) $bill_output["billmes"].= " (AuthCode: ".$x_auth_code.") ";
if(!empty($x_trans_id)) $bill_output["billmes"].= " (TransID: ".$x_trans_id.") ";
if(!empty($x_response_subcode)) $bill_output["billmes"].= " (subcode/reasoncode: ".$x_response_subcode."/".$x_response_reason_code.") ";
if(!empty($x_avs_code)) $bill_output["avsmes"] = "AVS Code: ".$x_avs_code;
include($xcart_dir."/payment/payment_ccend.php");
}
else
{
if (!defined('XCART_START')) { header("Location: ../"); die("Access denied"); }
$_orderids = $module_params ["param02"].join("-",$secure_oid);
$merchant = $module_params ["param01"];
if(!$duplicate)
db_query("REPLACE INTO $sql_tbl[cc_pp3_data] (ref,sessionid) VALUES ('".$_orderids."','".$XCARTSESSID."')");
?>
<HTML>
<BODY onLoad="document.process.submit();">
<FORM action="https://www.2checkout.com/cgi-bin/Abuyers/purchase.2c" method="POST" name="process">
<INPUT type="hidden" name="x_login" value="<?php echo htmlspecialchars($merchant); ?>">
<INPUT type="hidden" name="x_amount" value="<?php echo $cart["total_cost"]; ?>">
<INPUT type="hidden" name="x_invoice_num" value="<?php echo htmlspecialchars($_orderids); ?>">
<INPUT type="hidden" name="x_First_Name" value="<?php echo htmlspecialchars($userinfo["b_firstname"]); ?>">
<INPUT type="hidden" name="x_Last_Name" value="<?php echo htmlspecialchars($userinfo["b_lastname"]); ?>">
<INPUT type="hidden" name="x_Phone" value="<?php echo htmlspecialchars($userinfo["phone"]); ?>">
<INPUT type="hidden" name="x_Email" value="<?php echo htmlspecialchars($userinfo["email"]); ?>">
<INPUT type="hidden" name="x_Address" value="<?php echo htmlspecialchars($userinfo["b_address"]); ?>">
<INPUT type="hidden" name="x_City" value="<?php echo htmlspecialchars($userinfo["b_city"]); ?>">
<INPUT type="hidden" name="x_State" value="<?php echo htmlspecialchars($userinfo["b_state"]?$userinfo["b_state"]:"n/a"); ?>">
<INPUT type="hidden" name="x_Zip" value="<?php echo htmlspecialchars($userinfo["b_zipcode"]); ?>">
<INPUT type="hidden" name="x_Country" value="<?php echo htmlspecialchars($userinfo["b_country"]); ?>">
</FORM>
@checkout requires me to provide S_ID, total and just the merchant number. I am entering wrong CC information on Xcart payment screen just to see if it works or not , and still it is showing order to be successfull instead of telling me "MY CC was declined".
Anyone able to understand and resolve the issue? Would be great help.