Skip to content

Commit 0274107

Browse files
fix InvoiceItem.UnitPrice type (#849)
It's a string, not a float. A float makes sense, but I only get strings back on the wire. Fixes #848 Signed-off-by: Jordan Whited <[email protected]> Co-authored-by: Zhiwei Liang <[email protected]>
1 parent 10dc6c5 commit 0274107

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

account_invoices.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type InvoiceTaxSummary struct {
2929
type InvoiceItem struct {
3030
Label string `json:"label"`
3131
Type string `json:"type"`
32-
UnitPrice float32 `json:"unit_price"`
32+
UnitPrice string `json:"unit_price"`
3333
Quantity int `json:"quantity"`
3434
Amount float32 `json:"amount"`
3535
Tax float32 `json:"tax"`

test/unit/account_invoices_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ func TestAccountInvoiceItems_List(t *testing.T) {
8383
assert.Equal(t, float32(1.25), invoiceItem.Tax)
8484
assert.Equal(t, float32(21.45), invoiceItem.Total)
8585
assert.Equal(t, "hourly", invoiceItem.Type)
86-
assert.Equal(t, float32(5.05), invoiceItem.UnitPrice)
86+
assert.Equal(t, "5.05", invoiceItem.UnitPrice)
8787
}

test/unit/fixtures/account_invoice_items_list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"to": "2018-01-31T11:59:59",
1111
"total": 21.45,
1212
"type": "hourly",
13-
"unit_price": 5.05
13+
"unit_price": "5.05"
1414
}
1515
],
1616
"page": 1,

0 commit comments

Comments
 (0)