Reply
Member
Posts: 5
Registered: ‎04-05-2019

Getting error E00007 while trying to reach to Sandbox in VB basic code

Getting error E00007.

I am not sure how to specify the sandbox link i the code.

 

Could you please provide any pointers on this ?

 

Thanks in advance

Member
Posts: 5
Registered: ‎04-05-2019

Re: Getting error E00007 while trying to reach to Sandbox in VB basic code

Code is:

 

Public Sub ANetApiResponse(ByVal ApiLoginID As String, ByVal ApiTransactionKey As String, ByVal amount As Decimal)

ApiOperationBase(Of ANetApiRequest, ANetApiResponse).RunEnvironment = AuthorizeNet.Environment.SANDBOX
ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication = New merchantAuthenticationType()
ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication.name = ApiLoginID
ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication.ItemElementName = ItemChoiceType.transactionKey
ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication.Item = ApiTransactionKey

 

creditCardObject = New creditCardType
creditCardObject.cardNumber = "1111111111"
creditCardObject.expirationDate = "0703"
creditCardObject.cardCode = "111"
MsgBox(creditCardObject.cardNumber)


customerAddressObject = New customerAddressType
customerAddressObject.firstName = "Ankush"
customerAddressObject.lastName = "Verma"
customerAddressObject.address = "Street 29"
customerAddressObject.city = "Chicago"
customerAddressObject.zip = "60616"
MsgBox(customerAddressObject.firstName)

 

paymentTypeObject = New paymentType
paymentTypeObject.Item = creditCardObject
MsgBox(paymentTypeObject.Item.cardNumber)

 

itemsCheckout(0) = New lineItemType
itemsCheckout(0).itemId = "1"
itemsCheckout(0).name = "Monthly Plan"
itemsCheckout(0).quantity = 2
itemsCheckout(0).unitPrice = New Decimal(23.44)

 

transactionRequestTypeObject = New transactionRequestType
transactionRequestTypeObject.transactionType = transactionTypeEnum.authCaptureTransaction.ToString()
transactionRequestTypeObject.amount = amount
transactionRequestTypeObject.payment = paymentTypeObject
transactionRequestTypeObject.billTo = customerAddressObject

 

createTransactionReqObject = New createTransactionRequest
createTransactionReqObject.transactionRequest = transactionRequestTypeObject

 

controllerObject = New createTransactionController(createTransactionReqObject)

controllerObject.Execute()
MsgBox("Executed")

 

result = controllerObject.GetApiResponse()
MsgBox(result.messages.message(0).code.ToString)

 

End Sub