cancel
Showing results for 
Search instead for 
Did you mean: 

Prior AuthCapture

.NET C# I need to do an Auth, then capture that Auth with the CIM. I create the PriorAuthCaptureType and then try to get a CustomerProfileTransResponse but it blows up giving me a null exception when I submit it the PriorAuthCaptureType. I do have a problem with the other ProfileTransTypes. Everthing compiles and builds OK. Any suggestions ? I pasted the method I have below. 

 

public createCustomerProfileTransactionResponse CaptureCustomerProfile(string customerProfileId, string customerPaymentProfileId, string transId, decimal Amount, string apiLogin, string merchantKey) { HttpXmlUtility httpXmlUtility = new HttpXmlUtility(ServiceMode.Live, apiLogin, merchantKey); profileTransPriorAuthCaptureType _transCaptureOnly = new profileTransPriorAuthCaptureType(); _transCaptureOnly.transId = transId; _transCaptureOnly.amount = Amount; _transCaptureOnly.customerPaymentProfileId = customerPaymentProfileId; _transCaptureOnly.customerProfileId = customerProfileId; profileTransactionType _transactionType = new profileTransactionType(); _transactionType.Item = _transCaptureOnly; createCustomerProfileTransactionRequest _request = new createCustomerProfileTransactionRequest();
_request.transaction = _transactionType;
createCustomerProfileTransactionResponse _response = (createCustomerProfileTransactionResponse)httpXmlUtility.Send(_request); return _response; }

 

 

 Thx

glerler
Contributor
9 REPLIES 9

I see that you have

HttpXmlUtility(ServiceMode.Live, apiLogin, merchantKey);

 

Is this a test account or live/production account?

RaynorC1emen7
Expert

This is using a live account.

I have not had issues with the other profileTransactionTypes.

Thx for reading

G

Code look ok.

It getting null because it try to parse the respone, you can see the code in

https://github.com/AuthorizeNet/sdk-dotnet/blob/master/Authorize.NET/Utility/HttpXmlUtility.cs

 

It probably getting one of the E????? error, read the CIM xml

http://developer.authorize.net/api/cim/

 

If other transactiontype works, my guess would be the transactionID, can you login to the merchant account and see if the transactionID is valid?

 

 

 

I am getting a .NET null error.  The Exxx error I am well familiar with,  but I dont get as far the response.  .NET throws the no istance of the object and things kak.   I am using similar code for other TransTypes and I get a response to parse. If I use the captue only it works fine  but that creates another transaction.

 

I have merchant access and  the  profile, transID data is all good.  I wish I was getting the Exxx error cause then I know the where to look.  

 

This has me stumped.

 

 

If you run debug, the error was on https://github.com/AuthorizeNet/sdk-dotnet/blob/master/Authorize.NET/Utility/HttpXmlUtility.cs

The response is null

public ANetApiResponse Send(ANetApiRequest apiRequest) {
...
CheckForErrors
(response);

Download the source and change it to get the Exxxxx error.

Or just skip the SDKs and use the web service interface.

Please correct me if I am wrong but I did not see a priorAuthCapture in the CustomerGateway Interface.

Thank you for the replys.  Lol,  helps if I use the most recent  Auhtorize.dll.  I now have the PriorAuthCapture in the Gateway. I made a call directly thru the gateway and I am still getting the null exception.  I know the customer parameters are correct as well as the transactionId. 

Any suggestions?  I will set load the source code and see where it is dumping

Thx

 

OK - Learned something new.   You cannot capture a prior auth with CIM that was not orginally  created with that CIM profile.   I am doing the auth,  creating the CIM profile,  then going back and trying to capture that auth with the new CIM profile. Doesn't work.   So I would consider this immediate issue closed. 

 

Now..  What would be the suggested means to handle that scenario?