Reply
Highlighted
Member
Posts: 5
Registered: ‎02-03-2011

AIM Refund/Credit not accepting last four digits of Credit Card

Hi,

 

I am integrating via AIM and I am attempting to refund (or credit) on a settled transaction. The specification states the following:

 

"At least the last four digits of the credit card number (x_card_num) used for the original, successfully settled transaction are submitted. An expiration date is not required."

 

However, when I pass the transaction ID, amount and last four digits of the card to AuthorizeNetAIM::credit it throws this error:

 

AuthorizeNet Error:
Response Code: 3
Response Subcode: 1
Response Reason Code: 6
Response Reason Text: The credit card number is invalid.


It works when I pass the *full* card number and the expiry date, but this is a problem for me as I can't store this amount of data (for security reasons) and it contradicts the documentation.

 

Can anyone help me out? It would be much appreciated.

 

Best Regards,

Picco

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM Refund/Credit not accepting last four digits of Credit Card

Are you passing the masked last four like 'XXXX4154' with the XXXX in front?

Highlighted
Member
Posts: 5
Registered: ‎02-03-2011

Re: AIM Refund/Credit not accepting last four digits of Credit Card

Hi there,

 

No I am just passing four characters, please see the cURL string below. I am using PHP for the integration.

 

x_version=3.1&x_delim_char=%2C&x_delim_data=TRUE&x_relay_response=FALSE&x_encap_char=%7C&x_exp_date=01%2F13&x_amount=188.99&x_card_num=0001&x_type=CREDIT&x_login=MYLOGIN&x_tran_key=9728y896wRj5gBWa

 

Can anyone see the issue here?

 

The test card I used was 5404000000000001. I'm just about to call the support line to see if anyone can help me out there, but I think I may have more success on here.

 

Thanks,

Picco

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM Refund/Credit not accepting last four digits of Credit Card

Well, you need to pass in as a masked cc# so it will be x_card_num=XXXX00041

Highlighted
Member
Posts: 3
Registered: ‎01-24-2013

Re: AIM Refund/Credit not accepting last four digits of Credit Card

i am having a similar issue with AIM php, i have treid submitting the last four digits with and without the preceeding X's

 $transaction = new AuthorizeNetCP(AUTHORIZENET_API_LOGIN_ID, AUTHORIZENET_TRANSACTION_KEY); 

$response = $transaction->credit($trans_id,$refund_amount,$card_num); 
i am using the transaction detains api to get the card the masked card num
Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: AIM Refund/Credit not accepting last four digits of Credit Card

could be a bug because CP use x_ref_trans_id for credit while on AIM is use x_trans_id

Highlighted
Member
Posts: 3
Registered: ‎01-24-2013

Re: AIM Refund/Credit not accepting last four digits of Credit Card

Thanks, i went into the library and hard coded a x_ref_trans_id variable into the curl post data to be the transaction id and it successfully submited

Highlighted
Member
Posts: 3
Registered: ‎01-24-2013

Re: AIM Refund/Credit not accepting last four digits of Credit Card

i added

<pre>

 $transaction->setCustomField("x_ref_trans_id", $trans_id);

</pre>

and now everythin works fine

Highlighted
Member
Posts: 1
Registered: ‎10-17-2017

Re: AIM Refund/Credit not accepting last four digits of Credit Card

I ran into the same problem. Their documentation:

 

http://developer.authorize.net/api/reference/#payment-transactions-refund-a-transaction

 

actually has refTransID as an explicitly required field. However, their code sample omits it.

 

I added the following line to my (php) code and that made it work:

 

$transactionRequest->setRefTransId(123456789);

 

(where 123456789 is the number of your original transaction)