Hi im using DPM on codeigniter. Everthing is going fine. Tansaction is approved, i get the trans_id, response = 1 (approved). However i getting the above error as Error. Check your MD5 Setting.
HERE is my response with print_r($response)
AuthorizeNetSIM Object
(
[subscription_id] =>
[subscription_paynum] =>
[approved] =>
[declined] =>
[error] =>
[held] =>
[response_code] =>
[response_subcode] =>
[response_reason_code] =>
[response_reason_text] =>
[authorization_code] => UJ1PQ2
[avs_response] => Y
[transaction_id] => 2191231254
[invoice_number] =>
[description] =>
[amount] =>
[method] =>
[transaction_type] =>
[customer_id] =>
[first_name] =>
[last_name] =>
[company] =>
[address] =>
[city] =>
[state] =>
[zip_code] =>
[country] =>
[phone] =>
[fax] =>
[email_address] =>
[ship_to_first_name] =>
[ship_to_last_name] =>
[ship_to_company] =>
[ship_to_address] =>
[ship_to_city] =>
[ship_to_state] =>
[ship_to_zip_code] =>
[ship_to_country] =>
[tax] =>
[duty] =>
[freight] =>
[tax_exempt] =>
[purchase_order_number] =>
[md5_hash] => 7BED4793802CA86B7A9D515217B9029A
[card_code_response] => P
[cavv_response] => 2
[account_number] =>
[card_type] =>
[split_tender_id] =>
[requested_amount] =>
[balance_on_card] =>
[response] => Array
(
[x_response_code] => 1
[x_response_reason_code] => 1
[x_response_reason_text] => This transaction has been approved.
[x_avs_code] => Y
[x_auth_code] => UJ1PQ2
[x_trans_id] => 2191231254
[x_method] => CC
[x_card_type] => Discover
[x_account_number] => XXXX0012
[x_first_name] => John
[x_last_name] => Doe
[x_company] =>
[x_address] => 123 Main Street
[x_city] => Boston
[x_state] => MA
[x_zip] => 02142
[x_country] => US
[x_phone] =>
[x_fax] =>
[x_email] =>
[x_invoice_num] =>
[x_description] =>
[x_type] => auth_capture
[x_cust_id] =>
[x_ship_to_first_name] =>
[x_ship_to_last_name] =>
[x_ship_to_company] =>
[x_ship_to_address] =>
[x_ship_to_city] =>
[x_ship_to_state] =>
[x_ship_to_zip] =>
[x_ship_to_country] =>
[x_amount] => 5.99
[x_tax] => 0.00
[x_duty] => 0.00
[x_freight] => 0.00
[x_tax_exempt] => FALSE
[x_po_num] =>
[x_MD5_Hash] => 7BED4793802CA86B7A9D515217B9029A
[x_cvv2_resp_code] => P
[x_cavv_response] => 2
[x_test_request] => false
)
[api_login_id] => 94kK2nAJUmh
[md5_setting] => abc
[name] => false
)Error. Check your MD5 Setting.
and here is my code:
-------------------------------------------------------
private $api_login_id;
private $transaction_key;
private $relay_response_url;
private $md5_setting;
public function __construct() {
parent::__construct();
$this->load->library('authorizenet_dpm');
$this->api_login_id = '94kK5346Umh'; // changed
$this->transaction_key = '6L723467e8t32Lk'; //changed
$this->relay_response_url = 'http://www.domain.com/checkout/relay_response';
$this->md5_setting = 'abc';
$arr = array('api_login_id' => $this->api_login_id, 'md5_setting' =>$this->md5_setting);
$this->load->library('authorizenet_sim', $arr);
}
------------------------------------------------------------------------------------------------------------
public function relay_response(){
$redirect_url = "http://access-keys.com/perfume_new/checkout/order_reciept"; // Where theuserwill end up.
$response = new AuthorizeNetSIM($this->api_login_id, $this->md5_setting);
echo "<pre>";
print_r($response);echo "</pre>";
if ($this->authorizenet_sim->isAuthorizeNet())
{
if ($this->authorizenet_sim->approved)
{
// Do your processing here.
$redirect_url .= '?response_code=1&transaction_id=' .
$this->authorizenet_sim->transaction_id;
}
else
{
$redirect_url .= '?response_code='.$this->authorizenet_sim->response_code .
'&response_reason_text=' . $this->authorizenet_sim->response_reason_text;
}
// Send the Javascript back to AuthorizeNet, which will redirect userback toyour site.
$this->authorizenet_dpm->getRelayResponseSnippet($redirect_url);
}
else
{
echo "Error. Check your MD5 Setting.";
}
}
---------------------------------------------------------------------------------------------
public function order_reciept(){
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']);
}
}
Thank you.
Solved! Go to Solution.
04-11-2013 12:12 AM
So did you check your MD5 Setting? is the MD5 setting on the merchant account 'abc'?
04-11-2013 04:26 AM
So did you check your MD5 Setting? is the MD5 setting on the merchant account 'abc'?
04-11-2013 04:26 AM