Hello,
Is it necessarly that if x_type is "AUTH_ONLY" then x_method must be "ECHECK", if yes then how to implement AUTH_ONLY (x_type) with CC (x_method)
09-27-2011 06:30 AM
No. Read more at http://developer.authorize.net/integration/
09-27-2011 09:21 AM
Maybe something like this (untested since it's adapted from my authorize and capture implementation):
$authorize = new AuthorizeNetAIM(
$GLOBALS['_authorize_id'], $GLOBALS['_authorize_key']);
$authorize->setSandbox(true);
// Set to false if using production account
$fields = array(
'first_name' => $_POST['first'],
'last_name' => $_POST['last'],
'company' => $_POST['company'],
'address' => $_POST['address'],
'city' => $_POST['city'],
'state' => $_POST['state'],
'zip' => $_POST['zip'],
'country' => 'US',
'phone' => $_POST['phone'],
'email' => $_POST['email'],
'customer_ip' => $_SERVER['REMOTE_ADDR'],
'description' => "description here",
'amount' => $amount,
'card_num' => $_POST['card_number'],
'exp_date' => sprintf('%02d%02d', $_POST['card_exp_month'], ($_POST['card_exp_year'] % 1000)),
'card_code' => $_POST['card_ccv']
);
$authorize->setFields($fields);
if ($result->error || $result->{'response_code'} != 1)
$errors[] = "Authorization declined - {$result->response_reason_text}";
else
// do something with transaction ID so it can be captured laterOr you can just call the authorizeOnly function directly:
$authorize = new AuthorizeNetAIM(
$GLOBALS['_authorize_id'], $GLOBALS['_authorize_key']);
$authorize->setSandbox(true);
// Set to false if using production account
$result = $authorize->authorizeOnly($amount, $card_num, $exp_date);
// Process results
09-27-2011 11:39 PM