Reply
Member
Posts: 2
Registered: ‎05-22-2018

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.

 

 

 

 

Highlighted
Member
Posts: 2
Registered: ‎05-22-2018

Re: ANetApiResponse doesn't seem to have a transactionResponse in it -referencing it gives compile e

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?)