Reply
Highlighted
jdr
Member
Posts: 2
Registered: ‎03-15-2019

Accept Hosted - transactionRequestType.Order causes Unexpected Error

ASP.Net

 

I have tried exacly what is in the sample code:

https://developer.authorize.net/api/reference/features/accept_hosted.html

 

...by going to this link for the  sample code

https://developer.authorize.net/api/reference/#accept-suite-get-an-accept-payment-page

 

SAMPLE CODE:

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // authorize capture only
amount = amount,
order = new orderType
{
invoiceNumber = "INV-123456",
description = "TEST INVOICE"
}
};

 

Almost everything runs fine, right up to pressing the "Pay" button, then I get:

"Unexpected error. Please try again."

 

When I comment out the "order = new orderType..." section of the code, EVERYTHING then runs perfectly - the tranaction goes through, the receipt is displayed, email with receipt is received...

 

However, I do *NOT* get the invoiceNumber in the order - because I didn't set the values to avoid this weird "Unexpected error...".

 

I've ONLY tried this in the Sandbox.

 

I've also stepped through the code, and the values ARE proerly set before the nonce Token is created.

 

It's been many hours hunting for an answer - I can't believe I'm the first person to copy the sample code and have it blow up...

 

Thoughts?

jdr
Member
Posts: 2
Registered: ‎03-15-2019

Re: Accept Hosted - transactionRequestType.Order causes Unexpected Error

SOLVED - temporarily...

 

Rolled back the ASP.NET Authroize.Net SDK from version 2.0.0 to version 1.9.6

 

I found this posting saying 1.9.7 and 2.0.0 both have issues:
https://community.developer.authorize.net/t5/Integration-and-Testing/OrderType-is-causing-Unexpected...