cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize.Net SDK Error - "There was an error generating the XML document"

I'm using the following environment:

 

The request is successfully built however when I call the following code:

 

_oTranController = new AuthNetControllers.createTransactionController(apiRequest: _oTranRequest);
_oTranController.Execute();
_oResponse = _oTranController.GetApiResponse();

The response object is NULL

 

I get the exception There was an error generating the XML document

Nothing shows up anywhere else, just that error.

 

Any help appreciated.

ShadowDancerLV
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

Solution founds. 

Following fixes:

1. paymentType needed to be the actual  creditcard variable not an enumerator type.

               _paymentType = new AuthNetContract.paymentType
                {
                    Item = _creditCardType
                };

2. The expirationdate was returning 4 digit year instead of 2 digit year.

View solution in original post

ShadowDancerLV
Contributor
2 REPLIES 2

Additional details:

 

BaseUrl: https://test.authorize.net
CardPresentUrl: https://test.authorize.net
XmlBaseUrl: https://apitest.authorize.net

ShadowDancerLV
Contributor

Solution founds. 

Following fixes:

1. paymentType needed to be the actual  creditcard variable not an enumerator type.

               _paymentType = new AuthNetContract.paymentType
                {
                    Item = _creditCardType
                };

2. The expirationdate was returning 4 digit year instead of 2 digit year.

ShadowDancerLV
Contributor