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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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