cancel
Showing results for 
Search instead for 
Did you mean: 

Refund transaction error code "6" and error message "The credit card number is invalid"

Hello,

 

I am trying to integrate the  refund functionality in our Ecommerce system using Authorize.net PHP SDK, however, it seems the API and the documentions regarding the card number in the refund section is inconsistent. The API doc states that only the last four digits of the card is needed. On the other hard, when the request gets sent an error is generated and states "The credit card number is invalid". If I add the full credit card  number then the refund gets processed successfully.  

 

  1. Why is there inconsistency between documentation and API?
  2. How to process the refund using only the last four digits?. I also tried adding X as suggested here https://community.developer.authorize.net/t5/Integration-and-Testing/Refund-payments-using-AIM-API/t... , but this didn’t work.

 

I am testing it using my SANDBOX credentials.



mido
Member
1 ACCEPTED SOLUTION

Accepted Solutions

@mido I would first check response code 54 to see if any of the conditions apply: https://developer.authorize.net/api/reference/responseCodes.html?code=54

 

If the transaction is older than 120 days, your merchant can apply for expanded credit-return capabilities at http://www.authorize.net/content/dam/authorize/documents/ecc.pdf

 

Richard

View solution in original post

9 REPLIES 9

Hello @mido

 

When issuing a refund, you must include either a full card and expiration, or previous transID and last 4 of card number. If they don't have the last 4, you can use getTransactionDetails to get the payment object needed to issue a refund.

 

We have a ticket in to update our documentation to make this more clear.

 

Richard

RichardH
Administrator Administrator
Administrator

Hello @RichardH,

 

Thank you for the prompt reply. 

 

I followed your suggestion, however, I get a new error. The error code is 54 and the message is ":The referenced transaction does not meet the criteria for issuing a credit". However, if I added the full card number I don't get any error code. I attached a copy of the request that throws an error.  

 

 

<?xml version="1.0" encoding="UTF-8"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
   <merchantAuthentication>
      <name><![CDATA[xxxxxx]]></name>
      <transactionKey>xxxx</transactionKey>
   </merchantAuthentication>
   <refId><![CDATA[ref1460490748]]></refId>
   <transactionRequest>
      <transactionType><![CDATA[refundTransaction]]></transactionType>
      <amount>6.69</amount>
      <payment>
         <creditCard>
            <cardNumber><![CDATA[1111]]></cardNumber>
            <expirationDate>xxxx</expirationDate>
         </creditCard>
      </payment>
      <refTransId><![CDATA[2253946379]]></refTransId>
   </transactionRequest>
</createTransactionRequest>

 

It is a settled transaction or how old is the transaction?

If I remember correctly, you can't refund an unsettled transaction or transaction that older then 120 days.

 

updated 120 days

is in the AIM doc

http://www.authorize.net/content/dam/authorize/documents/AIM_guide.pdf

@RaynorC1emen7,

 

It was created today, however, the error doesn't happen when you submit the full card number. If it's throwing an error because it's not settled yet then the same response should be returned if the full card number is used and that doesn't happen. 

@mido I would first check response code 54 to see if any of the conditions apply: https://developer.authorize.net/api/reference/responseCodes.html?code=54

 

If the transaction is older than 120 days, your merchant can apply for expanded credit-return capabilities at http://www.authorize.net/content/dam/authorize/documents/ecc.pdf

 

Richard

When you pass in the full cc#, it think you are doing a unlinked credit.

Also in the AIM doc.

@RaynorC1emen7, Thanks for the heads up !!!!. 

 

@RichardH, The only reason I could think of is the transaction has not been settled yet. I will wait for it till it's settled and try it again. Thanks. 

 

Hello @RichardH,

 

Thanks for your help. I tried it today morning and the refund was successful. The transactions needed to be settled first and that what caused the 54 error code. 

 

It will be helpful if the sample code here https://github.com/AuthorizeNet/sample-code-php/tree/547daabc90ff0f579530d6e5295c02d52e27b257/Paymen... included an example to show how to issue a refund using the TransID and this example https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/refund-transaction.p... should be renamed to unlinked-credit-refund transaction .

 

 

@mido I'll pass on your suggestions to the API team.

 

Richard