Hi. I am using the following C# code to post transactions and the Merchant Email Receipt doesn't display Customer Billing Information or Customer Shipping Information. Can you explain what changes need to be made in order for this information to be displayed in the receipt? Thank you.
NameValueCollection collection = new NameValueCollection();
collection.Add("x_login", EncryptionUtility.DecryptData(authorize.ApiLoginId));
collection.Add("x_tran_key", EncryptionUtility.DecryptData(authorize.TransKey));
collection.Add("x_delim_data", "TRUE");
collection.Add("x_delim_char", "|");
collection.Add("x_relay_response", "FALSE");
collection.Add("x_type", "AUTH_CAPTURE");
collection.Add("x_method", "CC");
collection.Add("x_card_num", txtCardNumber.Text.Trim());
collection.Add("x_exp_date", expiration);
collection.Add("x_amount", "1.00");
collection.Add("x_description", desc);
collection.Add("x_first_name", txtFirstName.Text.Trim());
collection.Add("x_last_name", txtLastName.Text.Trim());
collection.Add("x_address", txtAddress1.Text.Trim());
collection.Add("x_city", txtCity.Text.Trim());
collection.Add("x_state", cmbState.Text);
collection.Add("x_zip", txtZipCode.Text.Trim());
collection.Add("x_email", txtEmail.Text.Trim());
collection.Add("x_email_customer", "TRUE");
collection.Add("x_ship_to_first_name", txtFirstName.Text.Trim());
collection.Add("x_ship_to_last_name", txtLastName.Text.Trim());
collection.Add("x_ship_to_company", txtCompany.Text.Trim());
collection.Add("x_ship_to_address", String.Format("{0} {1}", txtShippingAddress1.Text.Trim(), txtShippingAddress2.Text.Trim()));
collection.Add("x_ship_to_city", txtShippingCity.Text.Trim());
collection.Add("x_ship_to_state", cmbShippingState.Text);
collection.Add("x_ship_to_zip", txtShippingZipCode.Text.Trim());
collection.Add("x_test_request", "FALSE");
var request = new AuthorizationRequest(collection);
var gate = new Gateway(collection.Get("x_login"), collection.Get("x_tran_key"), false);
var response = gate.Send(request);
Solved! Go to Solution.
10-01-2013 07:58 AM
I found the following post which helped me correct the problem:
You have to add items in collection to the request object after it has been created.
foreach(String key in collection.AllKeys)
{
request.AddMerchantValue(key, collection[key]);
}
10-02-2013 11:00 AM
I found the following post which helped me correct the problem:
You have to add items in collection to the request object after it has been created.
foreach(String key in collection.AllKeys)
{
request.AddMerchantValue(key, collection[key]);
}
10-02-2013 11:00 AM