cancel
Showing results for 
Search instead for 
Did you mean: 

AIM refund not working

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.

 

 

11 REPLIES 11

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.

RaynorC1emen7
Expert

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.

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

  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?

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.

I have double checked the loginid and transactionkey. But it gives the same .

Have you try another auth/capture transaction to make sure it still work?

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?

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