public ActionResult Post(HerokuRequest request) { if (!Authorize()) { Response.StatusCode = 401; return(Content("Unauthorized")); } Trace(SummaryWriter.GetSummary(request)); var org = _createOrganisationCommand.Invoke(new CreateOrganisationRequest() { Email = request.heroku_id, FirstName = "Root", LastName = "AppHarbor User", OrganisationName = request.heroku_id, Password = Membership.GeneratePassword(10, 5), SpecialUser = SpecialUser.AppHarbor, CallbackUrl = request.callback_url, }); if (org.Status != CreateOrganisationStatus.Ok) { Trace(org.Status.ToString()); Response.StatusCode = 400; return(Content(org.Status.ToString())); } var setPlanResponse = _setExternallyBilledSubscriptionCommand.Invoke(new SetExternallyBilledSubscriptionRequest() { ExternalPlanId = request.plan, PlanType = PaymentPlanType.AppHarbor, OrganisationId = org.OrganisationId, }); if (setPlanResponse.Status != SetExternallyBilledSubscriptionStatus.Ok) { Trace(setPlanResponse.Status.ToString()); Response.StatusCode = 503; return(new PlainJsonNetResult(new { message = setPlanResponse.Status.ToString() })); } //create organisation & application with AppHarbor user var application = Core.Session.Raven.Load <Application>(org.ApplicationId); return(new PlainJsonNetResult(new{ id = IdHelper.GetFriendlyId(org.OrganisationId), config = new { ERRORDITE_TOKEN = application.Token, ERRORDITE_URL = "https://www.errordite.com/receiveerror" }, message = "Welcome to Errordite!" })); }
/// <summary> /// Uses the SummaryWriter to (efficiently) output an object to the trace. /// </summary> public void TraceObject <T>(T obj) where T : class { var type = obj == null ? typeof(T) : obj.GetType(); Auditor.Trace(type, SummaryWriter.GetSummary(obj)); }