I have a live account in Test mode and when using the instructions from the PHP SDK, I keep getting "Error. Check your MD5 Setting". When I remove 'relay_response_url', it goes through fine.
Initially, I had nothing entered for MD5, but when this happened, I entered something simple (abc) and tried again. No luck. As per the PDF insructions, I created these 3 files. Any ideas/thoughts would be appreciated:
CHECKOUT_FORM.PHP
<?php
require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK
$relay_response_url = "http://DOMAIN/relay_reponse.php";
$api_login_id = 'LOGINID';
$transaction_key = 'TRANSKEY';
$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 'anet_php_sdk/AuthorizeNet.php';
$redirect_url = "http://DOMAIN/order_receipt.php";
$api_login_id = 'LOGINID';
$md5_setting = "abc";
$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;
}
// 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']);
}
?>
Thanks you.
05-09-2012 06:55 PM
in your account setting > click MD5 Hash >
then enter the Hash you want to use... put that same code in the $md5_setting = "[HERE]";
05-09-2012 07:35 PM
i have enter the same code in $md_setting still i got the transction id =0 ,Please give me solution for it
08-08-2012 03:27 AM
Are you getting an error or just getting transactionID = 0? if just the transactionID = 0, turn test mode off.
08-08-2012 04:33 AM
now test mode is off .Now i got the error "Error -- not AuthorizeNet. Check your MD5 Setting". i set the $md5_setting ="4Um2hB2qD2"; but still got this error.
08-09-2012 02:44 AM
"4Um2hB2qD2" It that your loginID? md5 should be blank unless you set it.
08-09-2012 04:35 AM
hello i have done some changes in my code .I followed instruction "https://developer.authorize.net/integration/fifteenminutes/#directpost" from this link.
add_amount.php
<form method="post" action="direct_post.php"> <table> <tr> <td>Amount : <input type="text" name="amt" id-"amt"/></td> </tr> <tr> <td> <input type="submit" name="submit_btn" value="submit" /></td> </tr> </table> </form>
direct_post.php
<?php require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK $url = "http:/MY_DOMAIN/direct_post.php"; $api_login_id = 'xxxxx'; $transaction_key = 'xxxxxxxxx'; $md5_setting = " "; // Your MD5 Setting //$amount = "200"; $amount = '"'.$_POST['amt'].'"'; AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting); ?>
if i run direct_post.php it will works properly. but when i run add_amount.php then it will give me the message "Error -- not AuthorizeNet. Check your MD5 Setting.". actaully i want to take amount filed from the form.it is dyanamic not static.
08-13-2012 04:05 AM
Please help me out.....
08-23-2012 06:49 AM
The error that you referenced is an error confirming the transaction response. It is not related to how you specify the amount when the transaction is sent, other than using that amount to validate the response. You should make sure that you are using the correct MD5 hash and that the amount you are sending with the transaction is the same amount used when you verify the MD5 hash.
08-23-2012 11:05 AM
I dont have an answer, but if you figure it out post solution as I'm trying the exact same thing.
08-24-2012 10:19 AM