Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BTCPayServer.Plugins.Branta/Data/Domain/InvoiceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class InvoiceData

public string ZeroKnowledgeSecret { get; set; }

public string PluginVersion { get; set; }

public string GetVerifyLink()
{
if (ExpirationDate <= DateTime.UtcNow || Status != InvoiceDataStatus.Success)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BTCPayServer.Plugins.Branta.Migrations
{
/// <inheritdoc />
public partial class AddPluginVersionToInvoiceData : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PluginVersion",
schema: "BTCPayServer.Plugins.Branta",
table: "Invoice",
type: "text",
nullable: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PluginVersion",
schema: "BTCPayServer.Plugins.Branta",
table: "Invoice");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("PaymentId")
.HasColumnType("text");

b.Property<string>("PluginVersion")
.HasColumnType("text");

b.Property<int>("ProcessingTime")
.HasColumnType("integer");

Expand Down
1 change: 1 addition & 0 deletions BTCPayServer.Plugins.Branta/Models/InvoiceDataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public InvoiceDto(InvoiceData invoice)
Status = invoice.Status;
FailureReason = invoice.FailureReason;
ExpirationDate = invoice.ExpirationDate;
PluginVersion = invoice.PluginVersion;
VerifyLink = invoice.GetVerifyLink();
}
}
Expand Down
3 changes: 2 additions & 1 deletion BTCPayServer.Plugins.Branta/Services/BrantaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ private async Task<InvoiceData> CreateInvoiceAsync(InvoiceEntity btcPayInvoice,
.Value,
Environment = brantaSettings.StagingEnabled ? Enums.ServerEnvironment.Staging : Enums.ServerEnvironment.Production,
StoreId = btcPayInvoice.StoreId,
ZeroKnowledgeSecret = secret
ZeroKnowledgeSecret = secret,
PluginVersion = Helper.GetVersion()
};

if (!brantaSettings.BrantaEnabled)
Expand Down
2 changes: 2 additions & 0 deletions BTCPayServer.Plugins.Branta/Views/UIBranta/ViewLogs.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<th>Status</th>
<th>Failure Reason</th>
<th>Verify Link</th>
<th>Plugin Version</th>
<th>Processing Time (ms)</th>
</tr>
</thead>
Expand Down Expand Up @@ -58,6 +59,7 @@
<span>Expired</span>
}
</td>
<td>@invoice.PluginVersion</td>
<td>@(invoice.ProcessingTime > 0 ? invoice.ProcessingTime : "")</td>
</tr>
}
Expand Down