From 78b28061b24bc6ca7d889025e608c229b346b3f4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 8 Nov 2017 21:56:27 -0500 Subject: [PATCH] use item plan name if no description --- src/Api/Models/InvoiceModel.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Api/Models/InvoiceModel.cs b/src/Api/Models/InvoiceModel.cs index fa9b37482..1ea4362a7 100644 --- a/src/Api/Models/InvoiceModel.cs +++ b/src/Api/Models/InvoiceModel.cs @@ -55,7 +55,18 @@ namespace Bit.Api.Models public Item(StripeInvoiceLineItem item) { Amount = (item.Amount / 100).ToString("F"); - Description = item.Description ?? "--"; + if(!string.IsNullOrWhiteSpace(item.Description)) + { + Description = item.Description; + } + else if(!string.IsNullOrWhiteSpace(item.Plan?.Name) && item.Quantity.GetValueOrDefault() > 0) + { + Description = $"{item.Quantity} x {item.Plan.Name}"; + } + else + { + Description = "--"; + } } public string Description { get; set; }