I doubt there's an error in my code, but I'm open to suggestions. The main reason I doubt it is that the transaction itself goes through; it's just the address information isn't being stored. Below is a code snippet as well as a copy of the data being sent:
========================
NameValueCollection post_values = new NameValueCollection();
post_values.Add("x_login", charge.CommerceLogin);
post_values.Add("x_tran_key", charge.CommercePassword);
post_values.Add("x_version", "3.1");
post_values.Add("x_delim_data", "TRUE");
post_values.Add("x_delim_char", "|");
post_values.Add("x_relay_response", "FALSE");
post_values.Add("x_type", "AUTH_CAPTURE");
post_values.Add("x_method", "CC");
post_values.Add("x_card_num", charge.CardNumber);
post_values.Add("x_card_code", charge.CVV);
post_values.Add("x_exp_date", charge.ExpirationDate);
post_values.Add("x_amount", charge.ChargeAmount.ToString("0.00"));
post_values.Add("x_description", charge.CustomerReference);
post_values.Add("x_address", String.Format("{0} {1}", charge.Address1, charge.Address2).Trim());
post_values.Add("x_city", charge.City);
post_values.Add("x_state", charge.StateCode);
post_values.Add("x_zip", charge.ZipCode);
post_values.Add("x_phone", charge.Phone);
post_values.Add("x_email", charge.EmailAddress);
post_values.Add("x_customer_ip", charge.IPAddress);
// here, I iterate through the post_values collection to get the name value pairs that are being sent to Authorize.Net
String post_string = "";
foreach (String field in post_values.Keys) {
post_string += String.Format("{0}={1}&", field, post_values[field]);
}
post_string = post_string.TrimEnd('&');
// log them.
Elmah.ErrorSignal.FromCurrentContext().Raise(new LogMessageException(post_string));
AuthorizationRequest request = new AuthorizationRequest(post_values);
Gateway gate = new Gateway(charge.CommerceLogin, charge.CommercePassword, true);
var response = gate.Send(request);
if (response.Approved) {
// here it is approved
} else {
// this would be a failure
}
========================
The following is output from the logging:
x_login=****REPLACED****
x_tran_key=****REPLACED****
x_version=3.1
x_delim_data=TRUE
x_delim_char=|
x_relay_response=FALSE
x_type=AUTH_CAPTURE
x_method=CC
x_card_num=****REPLACED****
x_card_code=****REPLACED****
x_exp_date=****REPLACED****
x_test_request=Y
x_amount=150.00
x_description=Courses for DV USD
x_address=111 main street
x_city=Addison
x_state=TX
x_zip=75001
x_phone=****REPLACED****
x_email=chris@livelyconsulting.com
x_customer_ip=72.48.207.78