I am attempting to create a test program that will submit a test transaction to authorize.net from a win forms c# application. The plan is to have a software solution that integrates with a card reader and submits the information to authorize.net for processing.
The issue that I am having is that when I attempt to send the request over the gateway, the program hangs. All lines of code, including the line that displays the response code do not get processed.
I have setup a test account and logged into test.authorize.net, and received an API login Id and transaction id. I am also using the sample credit card numbers that were provided in the test account confirmation email.
I am new to all of this so I am not too sure what I could be doing wrong. I have pasted a code snippet below and would appreciate any feedback as to what I might be doing wrong, thanks.
private void purchase(string track1, string track2, decimal amount)
{
Console.WriteLine("Purchasing....");
var request = new CardPresentAuthorizationRequest(10.0M, track1, track2);
string apiLoginId = "MY_API_ID"; //I use the real one in my code
string transactionKey = "MY_TRANSACTION_ID"; //I use the real one in my code
var gate = new CardPresentGateway(apiLoginId, transactionKey, true);
Console.WriteLine("Starting transaction");
var response = (CardPresentResponse)gate.Send(request, "Test request"); // This is the line of code my program never gets past
Console.WriteLine("Transaction complete");
Console.WriteLine("Purchased!: {0}: {1}", response.ResponseCode, response.Message);
}
12-22-2011 11:12 AM
Welcome to the world of computing.
12-23-2011 08:27 AM