I'm trying to setup dpm using php. The transaction goes through auth.net and is approved, it shows up in transaction list, auth.net also emails me confirm receipt, but it says an error occured after processing the transaction. Any help would be greatly appreciated. Thank You.
link to site:
http://www.bookwedge.net/checkout_form.php
checkout_form.php
<?php require_once 'anet_php_sdk/AuthorizeNet.php';
$relay_response_url = "relay_response.php";
$api_login_id = '4Tzqb74M4';
$transaction_key = '76Pwp7b32LH5H669';
$amount = "5.99";
$fp_sequence = "123";
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 = "order_receipt.php";
$api_login_id = '4Tzqb74M4';
$md5_setting = "12345";
$response = new AuthorizeNetSIM($api_login_id, $md5_setting);
if ($response->isAuthorizeNet())
{
if ($response->approved)
{
$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;
}
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 "Errors occured."
.htmlentities($_GET['response_reason_text']);
}?>
01-25-2012 12:10 PM
Did you setup the relay response url in your merchant account? And I think it need the absolute URL not relative URL
01-25-2012 02:19 PM