Hi all,
I have try to refund using AIM method.The code is following :
<?php
require_once('AuthnetAIM.class.php');
$payment = new AuthnetAIM(API_LOGIN_ID, TRANSACTION_KEY,true);
$payment->setTransactionType("CREDIT"); //This is for refunds only
$payment->setTransaction($cardno,'',$price);
$payment->setParameter("x_email", $email);
$payment->setParameter("x_email_customer", TRUE); //Enable Authorize.net auto customer email
$payment->setParameter("x_description", "Refund");
$payment->setParameter("x_trans_id",$transactionid);
$payment->process();
?>
The cardno is last four digit of card by which the transaction made. But it did not work. Please help me.
05-07-2014 08:20 AM
what was the response error messgae said?
and did the transaction settled already? because you can't refund it until it settled.
and it doesn't look like you are using the sample code or the sdks, so you might need to talk to the developer who developed it.
05-07-2014 08:33 AM - edited 05-07-2014 08:41 AM
The response comes like following:
<tr>
<td><b>Response Code</b></td><td>3</td>
</tr>
<tr>
<td><b>Response Subcode</b></td><td>2</td>
</tr>
<tr>
<td><b>Response Reason Code</b></td><td>13</td>
</tr>
<tr>
<td><b>Response Reason Text</b></td><td>The merchant login ID or password is invalid or the account is inactive.</td>
</tr>
<tr>
<td><b>Approval Code</b></td><td></td>
</tr>
<tr>
<td><b>AVS Result Code</b></td><td>P</td>
</tr>
<tr>
<td><b>Transaction ID</b></td><td>0</td>
</tr>
I have purchased a item with same merchant login ID, it run successfully. For refund it gives this error.
05-09-2014 03:18 AM
Don't know it did said the merchant id or password(transactionKey) is invalid, can you make sure it sending it to the right server?
test account to test server
production account to production server
05-09-2014 04:24 AM
I am using a developer account(in live mode) by which a made transaction successfully. The url which call for refund is "https://test.authorize.net/gateway/transact.dll".
I am unable to find why it gives the error.
Can you provide any other code by which I can made the refund transaction?
05-12-2014 02:39 AM
double check the loginid and transactionkey, log what exact was send on the post to test.authorize.net
the sample code show only auth_capture but you can change it to work with credit transaction.
05-12-2014 04:48 AM
I have double checked the loginid and transactionkey. But it gives the same .
05-12-2014 06:19 AM
Have you try another auth/capture transaction to make sure it still work?
05-12-2014 07:25 AM
Thanks for your suggestion. I regenerate the transaction key and make the refun transaction. It does not give that error . But now it gives a new error.
The response that come is following:
<tr>
<td><b>Response Code</b></td><td>3</td>
</tr>
<tr>
<td><b>Response Subcode</b></td><td>1</td>
</tr>
<tr>
<td><b>Response Reason Code</b></td><td>6</td>
</tr>
<tr>
<td><b>Response Reason Text</b></td><td>The credit card number is invalid.</td>
</tr>
<tr>
<td><b>Approval Code</b></td><td></td>
</tr>
<tr>
<td><b>AVS Result Code</b></td><td>P</td>
</tr>
<tr>
<td><b>Transaction ID</b></td><td>0</td>
</tr>
Is refund not work in TEST MODE?
05-13-2014 10:54 PM
It this a test account? if so, no need to set it to run it in test mode.
And yes, test mode do not create transactionID, a "0" mean you can't do refund, capture only, void or PRIOR_AUTH_CAPTURE
05-14-2014 04:13 AM