cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access response reason code

I'm using CNP AIM in my project and installed Autorize.Net package from package manager console.

 

When i try to capture an already captured prior auth transaction. Response is "the order already have been captured" and result code is 1 , that mean transaction is approved.

 

But i dont want that. In my system this transactions is not successful, so i want to check response reason code, but GetawayResponse do not have Response Reason Code property.

 

What can i do now? 

elevres
Member
6 REPLIES 6

What do you mean it do not have response reason code property? blank? 1?

RaynorC1emen7
Expert

For example in my code

 

apiRequest = new PriorAuthCaptureRequest(Convert.ToDecimal(pAmount), pTransactionID);

var response = gate.Send(apiRequest);

var ReturnCode = response.ResponseCode;
var ReturnReasonCode = response.ResponseReasonCode;

 there is no property ResponseReasonCode for response object. How can i access response reason code ? 

 

 

elevres
Member

.net SDKs?

 

https://github.com/AuthorizeNet/sdk-dotnet/blob/master/Authorize.NET/AIM/Responses/SIMResponse.cs

look like there Message property. Or try debug and see what in response

Yes, I'm using .net sdk .

 

I want tıo control response over response reason code.

 

For example

 

is response code = 1 and response reason code = 1 , i will return successful payment 

 

but if response code = 1 and response reason code != 1 then i will return unsuccessfull payment.

 

i cannot control this on response code because for example

 

response code = 1 and response reason code = 310 >> means the transcation is alreaduy have been captured

 

when i look response code it equals to 1 , for authorize.net it means successful trasnaction, bur my system it is not a successfull transaction. 

 

Sorry if cannot tell my problem properly 

 

But the transaction itself with that transactionID was approved. It just don't let you capture it again,

The only way is to test both response code and response reason code.

 

response.GetValue("response_reason_code");

SIMResponse has GetValue function , but GatewayResponse does not. So ı guess i should get response reason code like this

 

string response_reason_code = ((GatewayResponse)response).GetValueByIndex(3);