public Hashtable BuyerInfo(Hashtable request)
{
Dictionary<string, object> postvals = ServerUtils.ParseQueryString ((string)request["body"]);
Hashtable reply = new Hashtable ();
reply["content_type"] = "text/html";
if (!postvals.ContainsKey("btc_session_id")) {
reply["int_response_code"] = 403;
reply["str_response_string"] = "Forbidden due to missing session ID";
return reply;
}
UUID buyerID;
UUID sessKey = new UUID ((string)postvals["btc_session_id"]);
if (m_sessionkeyuser.ContainsKey(sessKey)) {
buyerID = m_sessionkeyuser[sessKey];
} else {
reply["int_response_code"] = 404;
reply["str_response_string"] = "Buyer not found - maybe session has expired?";
return reply;
}
string email;
if (!GetEmail (m_scenes[0].RegionInfo.ScopeID, buyerID, out email)) {
reply["int_response_code"] = 404;
reply["str_response_string"] = "Buyer not found or lacks email address";
return reply;
}
/*
IUserAccountService userAccountService = m_scenes[0].UserAccountService;
UserAccount ua;
ua = userAccountService.GetUserAccount (buyerID, "", "");
if (ua == null) {
reply["int_response_code"] = 404;
reply["str_response_string"] = "Buyer not found";
return reply;
}
if ( string.IsNullOrEmpty (ua.Email) ) {
reply["int_response_code"] = 404;
reply["str_response_string"] = "Buyer or lacks email address";
}
string buyer_email = ua.Email;
*/
reply["int_response_code"] = 200;
reply["str_response_string"] = email;
return reply;
}