I'm getting a php error...
Sandbox mode worked fine and the SDK is in place. I switched my account to live mode, updated/recopied the API Login ID and Transaction Key (in case they changed by going live), and added the $transaction-setSandbox(false); code.
I now get the following PHP error:
Notice: Undefined property: AuthorizeNetAIM_Response::$error_message
If I take out the setSandbox(false) line, the PHP error goes away and the normal authorize.net error 13 code shows (which makes sense as the sandbox code is trying to connect to a live account).
Any help would be greatly appreciated.
require_once 'anet_php_sdk/AuthorizeNet.php';
$transaction = new AuthorizeNetAIM('XXXXX, 'XXXXX'); // this is the line the error occurs
$transaction->setSandbox(false);
$transaction->amount = $amount;
$transaction->card_num = $number;
$transaction->exp_date = $expiration;
$transaction->first_name = $first;
$transaction->last_name = $last;
$response = $transaction->authorizeAndCapture();
if ($response->approved)
{
// some code
}
else
{
echo $response->error_message;
}
07-04-2012 06:21 PM
What displays if you do a print_r($response)?
07-05-2012 02:06 PM