From 3b61d6cd20d4e0f2719954b152ebc94db812fc3d Mon Sep 17 00:00:00 2001 From: Steven Davidovitz <13248+steved@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:31:16 -0800 Subject: [PATCH] fix: parse InvoiceErrorDetail.details as an object correctly (#217) --- invoice.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/invoice.go b/invoice.go index d13a53b..5f24aaa 100644 --- a/invoice.go +++ b/invoice.go @@ -146,9 +146,9 @@ type InvoiceAppliedTax struct { } type InvoiceErrorDetail struct { - LagoId uuid.UUID `json:"lago_id,omitempty"` - ErrorCode string `json:"error_code,omitempty"` - Details string `json:"details,omitempty"` + LagoId uuid.UUID `json:"lago_id,omitempty"` + ErrorCode string `json:"error_code,omitempty"` + Details map[string]any `json:"details,omitempty"` } type Invoice struct { @@ -185,10 +185,10 @@ type Invoice struct { Customer *Customer `json:"customer,omitempty"` Subscriptions []Subscription `json:"subscriptions,omitempty"` - Fees []Fee `json:"fees,omitempty"` - Credits []InvoiceCredit `json:"credits,omitempty"` - AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"` - ErrorDetails []InvoiceErrorDetail `json:"error_details,omitempty"` + Fees []Fee `json:"fees,omitempty"` + Credits []InvoiceCredit `json:"credits,omitempty"` + AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"` + ErrorDetails []InvoiceErrorDetail `json:"error_details,omitempty"` AppliedUsageThreshold []AppliedUsageThreshold `json:"applied_usage_threshold,omitempty"` }