cancel
Showing results for 
Search instead for 
Did you mean: 

CIM Refund - null transaction id

I am using the CIM library to issue refunds.  I am doing this though Authorize.NET's C# SDK Refund method.  While developing with a test account in test mode, I have noticed if I pass a NULL transactionId, the transaction successfully refunds. 

 

Is this by design and more importantly will this same behavior work live?  If don't need to track transactionId's to issue refunds, it would simply my implementation.

 

On a side note, I stumbled across this because the SDK is misleading.  While the ICustomerGateway interface displays the refund method signature as:

 

IGatewayResponse Refund(string profileID, string paymentProfileId, string approvalCode, string transactionId, decimal amount);

 

It is implemented in the CustomerGateway class as:

 

public IGatewayResponse Refund(string profileID, string paymentProfileId, string transactionId, string approvalCode, decimal amount)

 

Notice that the transactionId and approvalCode parameters are switched (approvalCode also isn't even used).

 

Thanks for any feedback. - Zach

breslaw
Member
4 REPLIES 4

Test mode doesn't always work the same way as live mode. Why use test mode on a sandbox account, given that sandbox is already essentially 100% testing anyway? That having been said - there's no logical reason why passing a null would work properly. The function has to know what transaction to refund for it to issue the refund. You should store the transaction ID's locally in your database, or you're going to make things a lot more difficult for yourself in the long run. Unless refunds are a rare occurrence and you can live with logging into your Authorize.net control panel and issuing them that way.

TJPride
Expert

Null transactionID is a unlinked refund. I think it enabled by default on test account, but need to apply for it on a live account. Like TJPride said, there is no reason to run anything on test mode for a test account.

RaynorC1emen7
Expert

RaynorC1emen7 - thanks for the info.

 

-Zach

Heh, nuts. Good catch.