Gold R12 Authorize.Net CIM refunds using payment profile

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Wed Jul 26, 2017 7:36 am

Anyone ever have trouble doing refunds when the form of payment is a stored credit card profile?

We have a client that keeps getting the error:
A valid referenced transaction ID is required (E00027)
We haven't isolated whether this happens just with partial refunds, full refunds or both. The latest occurrence was a partial refund.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Thu Jul 27, 2017 1:34 am

Hi Joe,

Are you sure this is Gold R12? We had a reported issue with refunds here: viewtopic.php?f=65&t=18730

It should have been fixed in Gold R12 though.

Let me know what you find out.

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Thu Jul 27, 2017 1:46 am

Yes ma'am, Gold R12 SR1.

In the AuthNet CIM provider code, the DoStandardRefund() correctly populates the reference transaction ID:

Code: Select all

req.transactionRequest.refTransId = captureTransaction.ProviderTransactionId;
However in DoProfileRefund() the refTransId is never populated. Without the original transaction ID, AuthNet has no way of knowing which transaction should be refunded.

According to the Authorize.Net CIM API, the reference transaction ID is required when issuing refunds. They do not make a distinction between standard and profile transactions.

https://developer.authorize.net/api/ref ... ransaction
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Thu Jul 27, 2017 3:32 am

I looked the issue up and it was closed without going through a second round of QA. Let me investigate and see what I can find out.

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Thu Aug 17, 2017 2:00 am

Hi Joe,

Sorry it's taken so long to get back. We had some confusion on our end that caused a delay.

Anyway, the error you are getting relates to a wait period when the batch of payments needs to settle first before a refund is possible.

https://community.developer.authorize.n ... td-p/26247

Authorize.Net settles transactions in your account once every 24 hours. In general, this means that most of your transactions settle in under 24 hours. However, the settlement sometimes takes an hour or two to complete after your designated transaction cut-off time. If you run a transaction just after your scheduled cut-off, it is therefore possible that it won't settle for up 26 hours (or longer if there is any unusual interruption at your payment processor).

Thanks
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Thu Aug 17, 2017 2:33 am

So you were able to confirm that refunds for payments paid via a stored card profile work so long as the transaction has already settled?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Fri Aug 18, 2017 4:15 am

Yes, that is what I am being told.

If you are still having problems with this, please let me know.

Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Wed Aug 23, 2017 6:38 am

Another client reporting the same problem. Gold R12 SR1.

Note in this screenshot that a number of days passed between when the original authorization was issued and the refund was attempted. Same exact scenario: Partial refund for payment made with a stored card profile does not work because the transaction ID is not being populated.
Capture.JPG
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Wed Aug 23, 2017 7:59 am

Ok. Let me check again on this. Thanks for taking the time to provide a screenshot. It really helps.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Katie » Wed Aug 23, 2017 8:16 am

Hi Joe,

Sorry - quick question. Do you know if the cc payment storage is on or off? It shouldn't need to be on, but I was just wondering because it may be the missing test case.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Wed Aug 23, 2017 8:36 am

CC storage is on in both cases.

Regular AuthNet can do a refund with just the x9999 number if the refund is requested within X days of the transaction.

But I'm about 90% sure that CIM requires the full 16 which means CC storage has to be on in order to have any chance at a refund. In other words, the CIM API won't accept just the x9999 for a refund, must have the full 16. The regular AuthNet would.

From the AuthNet API documentation:
The following elements belong to the element; include them only for credit card transactions.
When issuing a credit card refund, the request must include either a full card number and expiration, or previous transId and last 4 digits of the card number. If you don't have the last 4 digits, you can use getTransactionDetails to get the payment object needed to issue a refund.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Naveed » Mon Aug 28, 2017 11:48 pm

I tried refund with following test cases and refund worked for me in all cases:
1. Payment storage ON, new profile.
2. Payment storage ON, existing profile.
3. Payment storage Off, without a profile.
AbleMods wrote: However in DoProfileRefund() the refTransId is never populated. Without the original transaction ID, AuthNet has no way of knowing which transaction should be refunded.

According to the Authorize.Net CIM API, the reference transaction ID is required when issuing refunds. They do not make a distinction between standard and profile transactions.

https://developer.authorize.net/api/ref ... ransaction
I also tried to look for Authorize.net CIM API reference documentation as I want to clear about the "refTransId" field but there is no "refTransId" field available for CIM refund requests, but there is a "transId" field which I am not sure about.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Tue Aug 29, 2017 6:51 am

You populate the refTransId in every other transaction sent by the provider.

Capture: request.transactionRequest.refTransId = captureRequest.AuthorizeTransaction.ProviderTransactionId;
Void: req.transactionRequest.refTransId = authorizeTransaction.ProviderTransactionId;
StandardRefund: req.transactionRequest.refTransId = captureTransaction.ProviderTransactionId;

You're just not doing it in ProfileRefund: Profile refunds still need to know the original transaction ID, otherwise how do they know which transaction should be refunded?

I do not see a transId field specified in the AuthNet API documentation for createTransactionRequest(). So I don't know where you're getting that field from...all I see is refTransId.

Maybe I'm reading the API documentation wrong. But it clearly states:
Capture.JPG
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Naveed » Wed Aug 30, 2017 2:11 am

Yes there is a different API for Authorize.net CIM. Please check the Authorize.net CIM API reference documentation at:
http://www.grubtogo.com/authorize_net_cim.pdf

There is a "transId" field for sending the reference transaction Id.

I need your help to confirm the issue as I can not reproduce the issue myself. Please update the "transId" field to send the reference transaction Id and see if it solves the issue for you. Here is the code you need to update:

Place the following lines of code in the DoProfileRefund() function where we are preparing the request data:

Code: Select all

if (creditRequest.CaptureTransaction == null) throw new ArgumentNullException("refundRequest.CaptureTransaction");
else
{
	//The payment gateway assigned transaction ID of the original transaction            
	refundTrans.transId = creditRequest.CaptureTransaction.ProviderTransactionId;
}
I hope it will fix the issue, as the CIM API reference documentation says we should send this value.

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by Naveed » Thu Sep 07, 2017 5:08 pm

Hi Joe,

Any luck with this?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Thu Sep 07, 2017 9:40 pm

Haven't tried yet. Now I've got a hurricane headed straight at me so it's gonna be late next week assuming I have power and internet.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R12 Authorize.Net CIM refunds using payment profile

Post by AbleMods » Tue Oct 10, 2017 11:27 pm

Naveed, sorry for the delay. That hurricane was pretty bad, we took a direct hit.

Move to Florida, they said. Live the dream, they said. Nobody mentions you could get slammed by a hurricane when they suggest you move to Florida :D

I was finally able to test the fix, and it works. In the screen capture below, you can see my transaction on the live gateway, live mode. This transaction is a payment made using a stored card profile.

The full refund attempt on the same day of the order failed. Kind of expected that, since the transaction hadn't settled yet. But it should have been a different error.

The partial refund on the next day (after nightly settlement) also failed.

Once I installed the updated AuthNet CIM DLL with the fix, partial refund was successful. So the transaction ID definitely has to be passed to AuthNet.
Capture.JPG
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply