`Invoice.InvoiceLineItem`: add `Metered` property
Would it be possible to expose a Metered property in the Invoice.InvoiceLineItem model?
The value is already coming from the wire.
By adding this method:
public bool Metered
{
get { return GetValue<bool>("metered"); }
}
To this class: https://github.com/chargebee/chargebee-dotnet/blob/bbf3a09eb0148249eb93f4b2335fdd3920938bd9/ChargeBee/Models/Invoice.cs#L3119
Hi, In Invoice we have "status" property which will have pending as a value when it has line items that belong to items that are metered. So basically Item model has metered property but not Invoice.InvoiceLineItem. If that is not what you want could you please elaborate more what exactly you want.
It's s just that in my use case I needed to know exactly which InvoiceLineItem(s) of an Invoice were Metered.
We pulled that off in a hacky way:
private static bool IsMetered(this Invoice.InvoiceLineItem lineItem)
{
var jToken = lineItem.GetJToken();
return jToken["metered"] != null && (jToken["metered"]?.ToObject<bool>() ?? false);
}
Hi @dgaspar, Sorry for the delayed response. This issue has been fixed in v3.31.0 — the field is now available as expected.
You can find it here for reference: https://github.com/chargebee/chargebee-dotnet/blob/v3.31.0/ChargeBee/Models/Invoice.cs#L3642
I'll go ahead and close this issue since it's been resolved. Feel free to reopen it if you run into any trouble!