Add itemCode to Invoice Response (#784)

closes #779
This commit is contained in:
Andrew Camilleri
2019-04-24 15:36:35 +02:00
committed by Nicolas Dorier
parent d0d077642d
commit 44d1419af9
2 changed files with 15 additions and 0 deletions

View File

@@ -1656,6 +1656,15 @@ donation:
Assert.Equal("CAD", orangeInvoice.Currency);
Assert.Equal("orange", orangeInvoice.ItemDesc);
Assert.IsType<RedirectToActionResult>(publicApps.ViewPointOfSale(appId, 0, null, null, null, null, "apple").Result);
invoices = user.BitPay.GetInvoices();
var appleInvoice = invoices.SingleOrDefault(invoice => invoice.ItemCode.Equals("apple"));
Assert.NotNull(appleInvoice);
Assert.Equal("good apple", appleInvoice.ItemDesc);
// testing custom amount
var action = Assert.IsType<RedirectToActionResult>(publicApps.ViewPointOfSale(appId, 5, null, null, null, null, "donation").Result);
Assert.Equal(nameof(InvoiceController.Checkout), action.ActionName);

View File

@@ -125,6 +125,12 @@ namespace BTCPayServer.Models
get; set;
}
[JsonProperty("itemCode")]
public string ItemCode
{
get; set;
}
//"orderId":"orderId"
[JsonProperty("orderId")]
public string OrderId