eCart stuck on confirm page
Thanks for the quick reply.
Yes I did use the wizard to create the confirm page.
Here's the relevant code: (I think)
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$AuthNet_required = array();
$AuthNet_required[0] = array();
$AuthNet_required[1] = array();
$AuthNet_itemized = array();
$AuthNet_itemized[0] = array();
$AuthNet_itemized[1] = array();
$AuthNet_optional = array();
$AuthNet_optional[0] = array();
$AuthNet_optional[1] = array();
$cartIndex = 0;
$nextIndex = 0;
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_login";
$AuthNet_required[1][$nextIndex] = "Atomictesting";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_tran_key";
$AuthNet_required[1][$nextIndex] = "Blastradius09";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_version";
$AuthNet_required[1][$nextIndex] = "3.1";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_invoice_num";
$AuthNet_required[1][$nextIndex] = "".session_id() ."";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_test_request";
$AuthNet_required[1][$nextIndex] = "FALSE";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_method";
$AuthNet_required[1][$nextIndex] = "CC";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_type";
$AuthNet_required[1][$nextIndex] = "AUTH_CAPTURE";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_relay_response";
$AuthNet_required[1][$nextIndex] = "FALSE";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_delim_data";
$AuthNet_required[1][$nextIndex] = "TRUE";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_delim_char";
$AuthNet_required[1][$nextIndex] = "::";
$nextIndex = count($AuthNet_required[0]);
$AuthNet_required[0][$nextIndex] = "x_customer_ip";
$AuthNet_required[1][$nextIndex] = "".$_SERVER["REMOTE_ADDR"] ."";
$AuthNet_itemized[0][0] = "x_amount";
$AuthNet_itemized[1][0] = "".$atomicart->GrandTotal() ."";
$AuthNet_itemized[0][1] = "x_description";
$AuthNet_itemized[1][1] = "".$atomicart->TotalColumn("FullDetails") ."";
while ( !$atomicart->EOF() ) {
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "ID";
$AuthNet_itemized[1][$nextIndex] = "".$atomicart->DisplayInfo("ID") ."";
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "Name";
$AuthNet_itemized[1][$nextIndex] = "".$atomicart->DisplayInfo("Name") ."";
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "Description";
$AuthNet_itemized[1][$nextIndex] = "".$atomicart->DisplayInfo("Description") ."";
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "Quantity";
$AuthNet_itemized[1][$nextIndex] = "".$atomicart->DisplayInfo("Quantity") ."";
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "Price";
$AuthNet_itemized[1][$nextIndex] = "".$atomicart->DisplayInfo("Price") ."";
$nextIndex = count($AuthNet_itemized[0]);
$AuthNet_itemized[0][$nextIndex] = "Taxable";
$AuthNet_itemized[1][$nextIndex] = "YES";
$atomicart->MoveNext();
$cartIndex ++;
}
$atomicart->MoveFirst();
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_card_num";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["cc_number"]))?$_POST["cc_number"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_exp_date";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["exp_month"]))?$_POST["exp_month"]:"") ."".((isset($_POST["exp_year"]))?$_POST["exp_year"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_card_code";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["cvv"]))?$_POST["cvv"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_email_customer";
$AuthNet_optional[1][$nextIndex] = "TRUE";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_tax_exempt";
$AuthNet_optional[1][$nextIndex] = "FALSE";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_first_name";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["firstname"]))?$_POST["firstname"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_last_name";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["lastname"]))?$_POST["lastname"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_address";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["street1"]))?$_POST["street1"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_city";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["city"]))?$_POST["city"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_state";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["state_province"]))?$_POST["state_province"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_zip";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["postcode"]))?$_POST["postcode"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_phone";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["phone"]))?$_POST["phone"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_fax";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["fax"]))?$_POST["fax"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_email";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["email"]))?$_POST["email"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_country";
$AuthNet_optional[1][$nextIndex] = "".((isset($_POST["country"]))?$_POST["country"]:"") ."";
$nextIndex = count($AuthNet_optional[0]);
$AuthNet_optional[0][$nextIndex] = "x_recurring_billing";
$AuthNet_optional[1][$nextIndex] = "NO";
$WAGatewayResponse = AuthNet_Post($AuthNet_required,$AuthNet_itemized,$AuthNet_optional);
if ($WAGatewayResponse) {
$atomicart->redirStr = "checkout_success.php";
}
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
exit();
}
}