// GET api/invoice/5
 public HttpResponseMessage GetUpcoming(string id, bool upcoming, int organizationId)
 {
     this.OrganizationId = organizationId;
     try
     {
         if (this.UserIsAdminOfOrganization)
         {
             var invoiceService = new StripeInvoiceService();
             StripeInvoice response;
             if (upcoming)
             {
                 var invoice = subscriptionService.GetUpcomingInvoice(id);
                 return Request.CreateResponse(HttpStatusCode.OK, invoice);
             }
             else
             {
                 response = invoiceService.Get(id);
             }
             return Request.CreateResponse(HttpStatusCode.OK, response);
         }
     }
     catch (StripeException ex)
     {
         emailHelper.SendStripeError(ex);
     }
     catch (Exception e)
     {
         emailHelper.SendErrorEmail(e);
     }
     return Request.CreateResponse(HttpStatusCode.BadRequest);
 }
        public ActionResult Payment(string id) {
            if (String.IsNullOrEmpty(id))
                return HttpNotFound();

            if (!id.StartsWith("in_"))
                id = "in_" + id;

            var invoiceService = new StripeInvoiceService();
            StripeInvoice invoice = invoiceService.Get(id);
            if (invoice == null)
                return HttpNotFound();

            Organization org = _repository.GetByStripeCustomerId(invoice.CustomerId);
            if (org == null)
                return HttpNotFound();

            if (!CanAccessOrganization(org.Id))
                return HttpNotFound();

            return View(new InvoiceModel { Invoice = invoice, Organization = org });
        }