Your script timed out while we were trying to post transaction results to it.
Transaction ID: 0
Transaction Result: This transaction cannot be accepted.
So I keep getting this error. I used the starter code at the end of the documentation for the DPM. It's all pretty much the same code, but with my own settings in it, and yet it's not working:
checkout_form.php:
<?php
require_once 'sdk-php-master/autoload.php'; // The SDK
$relay_response_url = "http://mysite.com/AuthorizeNet/relay_response.php"; // You will create this file in Step 7.
$api_login_id = 'THISISCORRECT';
$transaction_key = 'THISISCORRECT';
$amount = "5.99";
$fp_sequence = "123"; // Any sequential number like an invoice number.
echo AuthorizeNetDPM::getCreditCardForm($amount, $fp_sequence, $relay_response_url,$api_login_id, $transaction_key);
?>
relay_response.php:
<?php
require_once 'sdk-php-master/autoload.php'; // The SDK
$redirect_url = "http://mysite.com/AuthorizeNet/order_receipt.php"; // Where the user will end up.
$api_login_id = 'THISISCORRECT';
$md5_setting = "THISISCORRECT"; // Your MD5 Setting
$response = new AuthorizeNetSIM($api_login_id, $md5_setting);
if ($response->isAuthorizeNet()) {
if ($response->approved) {
// Do your processing here.
$redirect_url .= '?response_code=1&transaction_id=' .
$response->transaction_id;
} else {
$redirect_url .= '?response_code='.$response->response_code .
'&response_reason_text=' . $response->response_reason_text . '&nope=nope';
}
// Send the Javascript back to AuthorizeNet, which will redirect user back to your site.
echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_url);
} else {
echo "Error. Check your MD5 Setting.";
}?>
order_receipt.php:
<?php
if ($_GET['response_code'] == 1) {
echo "Thank you for your purchase! Transaction id: "
. htmlentities($_GET['transaction_id']);
} else {
echo "Sorry, an error occurred: " . htmlentities($_GET['response_reason_text']);
}
?>
What am I doing wrong here?
07-31-2014 04:16 PM