feat: produtos
This commit is contained in:
parent
1cc8665176
commit
fc211367a6
@ -16,7 +16,8 @@
|
||||
"Bash(pkill:*)",
|
||||
"Bash(sudo rm:*)",
|
||||
"Bash(rm:*)",
|
||||
"Bash(curl:*)"
|
||||
"Bash(curl:*)",
|
||||
"Bash(docker-compose up:*)"
|
||||
]
|
||||
},
|
||||
"enableAllProjectMcpServers": false
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
@ -24,8 +24,4 @@
|
||||
<EmbeddedResource Include="Resources\**\*.resx" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Views\Payment\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -16,11 +16,6 @@ public class PaymentController : Controller
|
||||
_authService = authService;
|
||||
}
|
||||
|
||||
public IActionResult Plans()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> CreateCheckoutSession(string planType)
|
||||
{
|
||||
@ -44,7 +39,7 @@ public class PaymentController : Controller
|
||||
catch (Exception ex)
|
||||
{
|
||||
TempData["Error"] = $"Erro ao processar pagamento: {ex.Message}";
|
||||
return RedirectToAction("Plans");
|
||||
return RedirectToAction("Pricing", "Home");
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +52,7 @@ public class PaymentController : Controller
|
||||
public IActionResult Cancel()
|
||||
{
|
||||
TempData["Info"] = "Pagamento cancelado. Você pode tentar novamente quando quiser.";
|
||||
return RedirectToAction("Plans");
|
||||
return RedirectToAction("Pricing", "Home");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
1
src/BCards.Web/StartStripeCLI.bat
Normal file
1
src/BCards.Web/StartStripeCLI.bat
Normal file
@ -0,0 +1 @@
|
||||
stripe listen --forward-to localhost:49178/webhook/stripe
|
||||
@ -301,4 +301,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<a asp-controller="Auth" asp-action="Login" class="btn btn-outline-light btn-lg px-4">
|
||||
Entrar
|
||||
</a>
|
||||
<a asp-controller="Auth" asp-action="Login" class="btn btn-light btn-lg px-4">
|
||||
Começar Grátis
|
||||
</a>
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
@if (User.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
<form asp-controller="Payment" asp-action="CreateCheckoutSession" method="post">
|
||||
<input type="hidden" name="planType" value="basic" />
|
||||
<input type="hidden" name="planType" value="Basic" />
|
||||
<button type="submit" class="btn btn-outline-primary w-100">Escolher Básico</button>
|
||||
</form>
|
||||
}
|
||||
@ -154,7 +154,7 @@
|
||||
@if (User.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
<form asp-controller="Payment" asp-action="CreateCheckoutSession" method="post">
|
||||
<input type="hidden" name="planType" value="professional" />
|
||||
<input type="hidden" name="planType" value="Professional" />
|
||||
<button type="submit" class="btn btn-warning w-100">Escolher Profissional</button>
|
||||
</form>
|
||||
}
|
||||
@ -212,7 +212,7 @@
|
||||
@if (User.Identity?.IsAuthenticated == true)
|
||||
{
|
||||
<form asp-controller="Payment" asp-action="CreateCheckoutSession" method="post">
|
||||
<input type="hidden" name="planType" value="premium" />
|
||||
<input type="hidden" name="planType" value="Premium" />
|
||||
<button type="submit" class="btn btn-primary w-100 fw-bold">Escolher Premium</button>
|
||||
</form>
|
||||
}
|
||||
@ -342,4 +342,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (TempData["Success"] != null)
|
||||
{
|
||||
<div class="toast-container position-fixed top-0 end-0 p-3">
|
||||
<div class="toast show" role="alert">
|
||||
<div class="toast-header">
|
||||
<i class="fas fa-check-circle text-success me-2"></i>
|
||||
<strong class="me-auto">Sucesso</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
|
||||
</div>
|
||||
<div class="toast-body">
|
||||
@TempData["Success"]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TempData["Error"] != null)
|
||||
{
|
||||
<div class="toast-container position-fixed top-0 end-0 p-3">
|
||||
<div class="toast show" role="alert">
|
||||
<div class="toast-header">
|
||||
<i class="fas fa-exclamation-triangle text-warning me-2"></i>
|
||||
<strong class="me-auto">Atenção</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
|
||||
</div>
|
||||
<div class="toast-body">
|
||||
@TempData["Error"]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TempData["Info"] != null)
|
||||
{
|
||||
<div class="toast-container position-fixed top-0 end-0 p-3">
|
||||
<div class="toast show" role="alert">
|
||||
<div class="toast-header">
|
||||
<i class="fas fa-exclamation-triangle text-primary me-2"></i>
|
||||
<strong class="me-auto">Atenção</strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
|
||||
</div>
|
||||
<div class="toast-body">
|
||||
@TempData["Info"]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@ -11,14 +11,14 @@
|
||||
"DatabaseName": "BCardsDB"
|
||||
},
|
||||
"Stripe": {
|
||||
"PublishableKey": "pk_test_your_publishable_key_here",
|
||||
"SecretKey": "sk_test_your_secret_key_here",
|
||||
"WebhookSecret": "whsec_your_webhook_secret_here"
|
||||
"PublishableKey": "pk_test_51RjUmIBMIadsOxJVP4bWc54pHEOSf5km1hpOkOBSoGVoKxI46N4KSWtevpXCSq68OjFazBuXmPJGBwZ1KDN5MNJy003lj1YmAS",
|
||||
"SecretKey": "sk_test_51RjUmIBMIadsOxJVeqsMFxnZ8ePR7d8IbnaF4sAwBVJv9rrfODPEQ2C9fF3beoABpITdfzEk0ZDzGTTQfvKv63xI00PeZoABGO",
|
||||
"WebhookSecret": "whsec_8d189c137ff170ab5e62498003512b9d073e2db50c50ed7d8712b7ef11a37543"
|
||||
},
|
||||
"Authentication": {
|
||||
"Google": {
|
||||
"ClientId": "your_google_client_id",
|
||||
"ClientSecret": "your_google_client_secret"
|
||||
"ClientId": "472850008574-nmeepbdt4hunsk5c8krpbdmd3olc4jv6.apps.googleusercontent.com",
|
||||
"ClientSecret": "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"
|
||||
},
|
||||
"Microsoft": {
|
||||
"ClientId": "b411606a-e574-4f59-b7cd-10dd941b9fa3",
|
||||
@ -27,22 +27,22 @@
|
||||
},
|
||||
"Plans": {
|
||||
"Basic": {
|
||||
"PriceId": "price_basic_monthly",
|
||||
"PriceId": "price_1RjUskBMIadsOxJVgLwlVo1y",
|
||||
"Price": 9.90,
|
||||
"MaxLinks": 5,
|
||||
"Features": ["basic_themes", "simple_analytics"]
|
||||
"Features": [ "basic_themes", "simple_analytics" ]
|
||||
},
|
||||
"Professional": {
|
||||
"PriceId": "price_professional_monthly",
|
||||
"PriceId": "price_1RjUv9BMIadsOxJVORqlM4E9",
|
||||
"Price": 24.90,
|
||||
"MaxLinks": 15,
|
||||
"Features": ["all_themes", "advanced_analytics", "custom_domain"]
|
||||
"Features": [ "all_themes", "advanced_analytics", "custom_domain" ]
|
||||
},
|
||||
"Premium": {
|
||||
"PriceId": "price_premium_monthly",
|
||||
"PriceId": "price_1RjUw0BMIadsOxJVmdouNV1g",
|
||||
"Price": 29.90,
|
||||
"MaxLinks": -1,
|
||||
"Features": ["custom_themes", "full_analytics", "multiple_domains", "priority_support"]
|
||||
"Features": [ "custom_themes", "full_analytics", "multiple_domains", "priority_support" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user