GreenField: Add StoreId to Invoice model (#2592)

This commit is contained in:
Andrew Camilleri
2021-06-24 16:15:51 +02:00
committed by GitHub
parent dca376cb46
commit cb2dd464f1
4 changed files with 7 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ namespace BTCPayServer.Client.Models
public class InvoiceData : CreateInvoiceRequest public class InvoiceData : CreateInvoiceRequest
{ {
public string Id { get; set; } public string Id { get; set; }
public string StoreId { get; set; }
public string CheckoutLink { get; set; } public string CheckoutLink { get; set; }
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public InvoiceStatus Status { get; set; } public InvoiceStatus Status { get; set; }

View File

@@ -1019,7 +1019,7 @@ namespace BTCPayServer.Tests
RedirectAutomatically = true RedirectAutomatically = true
}}); }});
Assert.True(newInvoice.Checkout.RedirectAutomatically); Assert.True(newInvoice.Checkout.RedirectAutomatically);
Assert.Equal(user.StoreId, newInvoice.StoreId);
//list //list
var invoices = await viewOnly.GetInvoices(user.StoreId); var invoices = await viewOnly.GetInvoices(user.StoreId);

View File

@@ -385,6 +385,7 @@ namespace BTCPayServer.Controllers.GreenField
{ {
return new InvoiceData() return new InvoiceData()
{ {
StoreId = entity.StoreId,
ExpirationTime = entity.ExpirationTime, ExpirationTime = entity.ExpirationTime,
MonitoringExpiration = entity.MonitoringExpiration, MonitoringExpiration = entity.MonitoringExpiration,
CreatedTime = entity.InvoiceTime, CreatedTime = entity.InvoiceTime,

View File

@@ -749,6 +749,10 @@
"type": "string", "type": "string",
"description": "The identifier of the invoice" "description": "The identifier of the invoice"
}, },
"storeId": {
"type": "string",
"description": "The store identifier that the invoice belongs to"
},
"checkoutLink": { "checkoutLink": {
"type": "string", "type": "string",
"description": "The link to the checkout page, where you can redirect the customer" "description": "The link to the checkout page, where you can redirect the customer"