cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

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
Who Me Too'd this topic