I'm trying to write code to explore the late payment transaction. In the code I have NameValueCollection object with the x_type set to AUTH_ONLY but when I create object of AuthorizationRequest with the collection, somehow it is automatically set type to AUTH_CAPTURE. I want to know how do I implement AUTH_ONLY transactions?
-
Dipesh
Solved! Go to Solution.
02-15-2013 02:37 AM
Just checked the code of Authorize.Net project from SDK and figured out that, even if you pass all values through NameValueCollection Parameter, it sets only three parameters, 1. CreditCardNumber, 2. CreditCardExpiration and 3. Amount. Even TransactionType (ApiAction) is not handled correctly in SDK.
Well, I am extending it further to resolve the loopholes so let me know if anyone needs updated SDK.
02-15-2013 05:14 AM
My Code is as Follow:
NameValueCollection nvcParam = new NameValueCollection();
nvcParam.Add(ApiFields.Type, "AUTH_ONLY");
nvcParam.Add(ApiFields.CreditCardNumber, "4111111111111111");
nvcParam.Add(ApiFields.CreditCardExpiration, "1216");
nvcParam.Add(ApiFields.CreditCardCode, "Test Transaction");
nvcParam.Add(ApiFields.Amount, "1.99");
nvcParam.Add(ApiFields.Description, "Test Transaction");
nvcParam.Add(ApiFields.PONumber, "S1");
AuthorizationRequest request = new AuthorizationRequest(nvcParam);
var gate = new Gateway(_apiLogin, _apiTransactionKey, true);
var response = gate.Send(request);
Console.WriteLine("{0}: {1}", response.ResponseCode, response.Message);
Console.WriteLine("Auth Code: {0}", response.AuthorizationCode);
02-15-2013 03:06 AM
Just checked the code of Authorize.Net project from SDK and figured out that, even if you pass all values through NameValueCollection Parameter, it sets only three parameters, 1. CreditCardNumber, 2. CreditCardExpiration and 3. Amount. Even TransactionType (ApiAction) is not handled correctly in SDK.
Well, I am extending it further to resolve the loopholes so let me know if anyone needs updated SDK.
02-15-2013 05:14 AM