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.
I am testing it using my SANDBOX credentials.
Solved! Go to Solution.
04-12-2016 11:48 AM - edited 04-12-2016 12:02 PM
@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
04-12-2016 01:19 PM
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
04-12-2016 12:30 PM
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>
04-12-2016 01:10 PM - edited 04-12-2016 01:11 PM
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
04-12-2016 01:13 PM - edited 04-12-2016 01:16 PM
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.
04-12-2016 01:18 PM
@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
04-12-2016 01:19 PM
When you pass in the full cc#, it think you are doing a unlinked credit.
Also in the AIM doc.
04-12-2016 01:28 PM
@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.
04-12-2016 01:42 PM
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 .
04-13-2016 08:12 AM
04-13-2016 08:14 AM