mirror of
https://github.com/bitwarden/server
synced 2026-01-17 07:53:36 +00:00
[PM-12420] Stripe events recovery (#4793)
* Billing: Add event recovery endpoints * Core: Add InternalBilling to BaseServiceUriSettings * Admin: Scaffold billing section * Admin: Scaffold ProcessStripeEvents section * Admin: Implement event processing * Run dotnet format
This commit is contained in:
25
src/Admin/Billing/Views/ProcessStripeEvents/Index.cshtml
Normal file
25
src/Admin/Billing/Views/ProcessStripeEvents/Index.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@model Bit.Admin.Billing.Models.ProcessStripeEvents.EventsFormModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Process Stripe Events";
|
||||
}
|
||||
|
||||
<h1>Process Stripe Events</h1>
|
||||
<form method="post" asp-controller="ProcessStripeEvents" asp-action="Process">
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Process" class="btn btn-primary mb-2"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" asp-for="Inspect">
|
||||
<label class="form-check-label" asp-for="Inspect"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea id="event-ids" type="text" class="form-control" rows="100" asp-for="EventIds"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
49
src/Admin/Billing/Views/ProcessStripeEvents/Results.cshtml
Normal file
49
src/Admin/Billing/Views/ProcessStripeEvents/Results.cshtml
Normal file
@@ -0,0 +1,49 @@
|
||||
@using Bit.Admin.Billing.Models.ProcessStripeEvents
|
||||
@model Bit.Admin.Billing.Models.ProcessStripeEvents.EventsResponseBody
|
||||
|
||||
@{
|
||||
var title = Model.ActionType == EventActionType.Inspect ? "Inspect Stripe Events" : "Process Stripe Events";
|
||||
ViewData["Title"] = title;
|
||||
}
|
||||
|
||||
<h1>@title</h1>
|
||||
<h2>Results</h2>
|
||||
|
||||
<div class="table-responsive">
|
||||
@if (!Model.Events.Any())
|
||||
{
|
||||
<p>No data found.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Type</th>
|
||||
<th>API Version</th>
|
||||
<th>Created</th>
|
||||
@if (Model.ActionType == EventActionType.Process)
|
||||
{
|
||||
<th>Processing Error</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var eventResponseBody in Model.Events)
|
||||
{
|
||||
<tr>
|
||||
<td><a href="@eventResponseBody.URL">@eventResponseBody.Id</a></td>
|
||||
<td>@eventResponseBody.Type</td>
|
||||
<td>@eventResponseBody.APIVersion</td>
|
||||
<td>@eventResponseBody.CreatedUTC</td>
|
||||
@if (Model.ActionType == EventActionType.Process)
|
||||
{
|
||||
<td>@eventResponseBody.ProcessingError</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
Reference in New Issue
Block a user