cancel
Showing results for 
Search instead for 
Did you mean: 

ANetApiResponse doesn't seem to have a transactionResponse in it -referencing it gives compile error

I am using .net with Visual Basic.

 

The following code all works perfectly fine. 

 

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

Dim p_cRequest = New createTransactionRequest()
p_cRequest.transactionRequest = p_cTransactionRequest

Dim p_cController As New createTransactionController(p_cRequest)

p_cController.Execute()

Dim p_cResponse As New ANetApiResponse

p_cResponse = p_cController.GetApiResponse

 

 

The problem I am having is that the sample code (in C#) has a reference like this...

 

response.transcationResponse.responseCode

 

That line is used to see if the card was approved, declined, etc...  The problem I am having is that the p_cResponse object that is set with the p_cController.GetApiResponse line doesn't seem to even *have* a transactionResponse object in it.  the intellisense doesn't show it as an addressable option and manually adding it causes a compile error.  I am stuck and lost.  I thought perhaps I was creating the "wrong" kind of response object but after searching through the doc and looking at what is being returned I think I have declared the same object type that is being returned.  Where/how do I get access to the transactionResponse object so I can see if the payment was declined?

 

If p_cResponse.transactionResponse.responseCode = ... <<<<< line that is problem, acts like transactionResponse is not a member of ANetApiResponse but doc says it should be there.

 

 

 

 

deanhupp
Member
2 REPLIES 2

I figured it out...

 

The response was a createTransactionResponse rather than an ANetApiResponse

 

Dim p_cResponse As New AuthorizeNet.Api.Contracts.V1.createTransactionResponse

 

(although does anyone find that class name a bit odd?)

 

deanhupp
Member

Thank you for figuring this out.

 

Authorize.Net example at:

https://github.com/AuthorizeNet/sample-code-csharp/blob/master/AcceptSuite/CreateAnAcceptPaymentTran...

 

On line 14 has:

public static ANetApiResponse Run(…

 

Where it should be:

public static createTransactionResponse Run(…