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

 I am using a developer account(in live mode) by which a made transaction successfully. After treansaction it gives a transaction id. I am refunding for that transaction. The url which call for refund is "https://test.authorize.net/gateway/transact.dll".

The outgoing parameters are :
<th colspan="2"><b>Outgoing Parameters</b></th>
<tr><td><b>x_delim_data</b></td><td>TRUE</td></tr>
<tr><td><b>x_delim_char</b></td><td>|</td></tr>
<tr><td><b>x_relay_response</b></td><td>FALSE</td></tr>
<tr><td><b>x_url</b></td><td>FALSE</td></tr>
<tr><td><b>x_version</b></td><td>3.1</td></tr>
<tr><td><b>x_method</b></td><td>CC</td></tr>
<tr><td><b>x_type</b></td><td>CREDIT</td></tr>
<tr><td><b>x_login</b></td><td>LOGIN_ID</td></tr>
<tr><td><b>x_tran_key</b></td><td>TRANSACTION_KEY</td></tr>
<tr><td><b>x_card_num</b></td><td>XXXX8888</td></tr>
<tr><td><b>x_exp_date</b></td><td>112015</td></tr>
<tr><td><b>x_amount</b></td><td>1.5</td></tr>
<tr><td><b>x_invoice_num</b></td><td>0</td></tr>
<tr><td><b>x_tax</b></td><td>0</td></tr>
<tr><td><b>x_card_code</b></td><td>000</td></tr>
<tr><td><b>x_email</b></td><td>EMAIL</td></tr>
<tr><td><b>x_email_customer</b></td><td>1</td></tr>
<tr><td><b>x_description</b></td><td>Refund</td></tr>
<tr><td><b>x_trans_id</b></td><td>8EAC6270FBD9491A991D8195D0E95359</td></tr>

transactionID is a number, I not sure what this is <tr><td><b>x_trans_id</b></td><td>8EAC6270FBD9491A

991D8195D0E95359</td></tr>