From 188571cad8648880dbdaff7b17eee0fc81a9bdb6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 18 Mar 2017 18:52:44 -0400 Subject: [PATCH] Billing project --- bitwarden-core.sln | 9 ++++- src/Api/Api.csproj | 1 + src/Billing/Billing.csproj | 21 +++++++++++ src/Billing/Controllers/StripeController.cs | 14 ++++++++ src/Billing/Program.cs | 23 ++++++++++++ src/Billing/Properties/launchSettings.json | 29 +++++++++++++++ src/Billing/Startup.cs | 40 +++++++++++++++++++++ src/Billing/settings.Development.json | 10 ++++++ src/Billing/settings.json | 8 +++++ src/Core/Core.csproj | 1 + src/Mail/Mail.csproj | 1 + 11 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 src/Billing/Billing.csproj create mode 100644 src/Billing/Controllers/StripeController.cs create mode 100644 src/Billing/Program.cs create mode 100644 src/Billing/Properties/launchSettings.json create mode 100644 src/Billing/Startup.cs create mode 100644 src/Billing/settings.Development.json create mode 100644 src/Billing/settings.json diff --git a/bitwarden-core.sln b/bitwarden-core.sln index 112f14c38a..fd4ae3c441 100644 --- a/bitwarden-core.sln +++ b/bitwarden-core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 +VisualStudioVersion = 15.0.26228.9 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}" EndProject @@ -20,6 +20,8 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Sql", "src\Sql\Sql.sqlproj" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mail", "src\Mail\Mail.csproj", "{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Billing", "src\Billing\Billing.csproj", "{02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -44,6 +46,10 @@ Global {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Debug|Any CPU.Build.0 = Debug|Any CPU {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.ActiveCfg = Release|Any CPU {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.Build.0 = Release|Any CPU + {02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -53,5 +59,6 @@ Global {E8548AD6-7FB0-439A-8EB5-549A10336D2D} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} {58554E52-FDEC-4832-AFF9-302B01E08DCA} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} + {02BC2982-ED8D-4A6D-A41E-092B3DAEB98A} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} EndGlobalSection EndGlobal diff --git a/src/Api/Api.csproj b/src/Api/Api.csproj index bb8e6729b1..d20119f8c9 100644 --- a/src/Api/Api.csproj +++ b/src/Api/Api.csproj @@ -14,6 +14,7 @@ false false false + Bit.Api diff --git a/src/Billing/Billing.csproj b/src/Billing/Billing.csproj new file mode 100644 index 0000000000..bdad4df7d1 --- /dev/null +++ b/src/Billing/Billing.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp1.1 + Bit.Billing + + + + + + + + + + + + + + + + diff --git a/src/Billing/Controllers/StripeController.cs b/src/Billing/Controllers/StripeController.cs new file mode 100644 index 0000000000..0e33d21353 --- /dev/null +++ b/src/Billing/Controllers/StripeController.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Bit.Billing.Controllers +{ + [Route("stripe")] + public class StripeController : Controller + { + [HttpPost("webhook")] + public void PostWebhook([FromBody]dynamic body) + { + + } + } +} diff --git a/src/Billing/Program.cs b/src/Billing/Program.cs new file mode 100644 index 0000000000..3881f4451a --- /dev/null +++ b/src/Billing/Program.cs @@ -0,0 +1,23 @@ +using System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; + +namespace Bit.Billing +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .UseApplicationInsights() + .Build(); + + host.Run(); + } + } +} diff --git a/src/Billing/Properties/launchSettings.json b/src/Billing/Properties/launchSettings.json new file mode 100644 index 0000000000..1e3b7b42dc --- /dev/null +++ b/src/Billing/Properties/launchSettings.json @@ -0,0 +1,29 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:44518/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Billing": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:44519" + } + } +} diff --git a/src/Billing/Startup.cs b/src/Billing/Startup.cs new file mode 100644 index 0000000000..07457cb41d --- /dev/null +++ b/src/Billing/Startup.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace Bit.Billing +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("settings.json", optional: false, reloadOnChange: true) + .AddJsonFile($"settings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc(); + } + + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + app.UseMvc(); + } + } +} diff --git a/src/Billing/settings.Development.json b/src/Billing/settings.Development.json new file mode 100644 index 0000000000..fa8ce71a97 --- /dev/null +++ b/src/Billing/settings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/Billing/settings.json b/src/Billing/settings.json new file mode 100644 index 0000000000..5fff67bacc --- /dev/null +++ b/src/Billing/settings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning" + } + } +} diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 1e63279db0..6e71211605 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -10,6 +10,7 @@ false false false + Bit.Core diff --git a/src/Mail/Mail.csproj b/src/Mail/Mail.csproj index 8087f3afd1..381e1a0f19 100644 --- a/src/Mail/Mail.csproj +++ b/src/Mail/Mail.csproj @@ -8,6 +8,7 @@ Mail 1.1.1 $(PackageTargetFallback);dotnet5.6;portable-net45+win8 + Bit.Mail