diff --git a/types.go b/types.go index 5bedbbd..c43c0f6 100644 --- a/types.go +++ b/types.go @@ -416,14 +416,12 @@ type ( // Item struct Item struct { - Quantity uint32 `json:"quantity"` Name string `json:"name"` - Price string `json:"price"` - Currency string `json:"currency"` - SKU string `json:"sku,omitempty"` - Description string `json:"description,omitempty"` - Tax string `json:"tax,omitempty"` UnitAmount *Money `json:"unit_amount,omitempty"` + Tax *Money `json:"tax,omitempty"` + Quantity string `json:"quantity"` + Description string `json:"description,omitempty"` + SKU string `json:"sku,omitempty"` Category string `json:"category,omitempty"` } diff --git a/unit_test.go b/unit_test.go index 4134af1..967d516 100644 --- a/unit_test.go +++ b/unit_test.go @@ -57,9 +57,7 @@ func TestTypeUserInfo(t *testing.T) { func TestTypeItem(t *testing.T) { response := `{ "name":"Item", - "price":"22.99", - "currency":"GBP", - "quantity":1 + "quantity":"1" }` i := &Item{} @@ -69,9 +67,7 @@ func TestTypeItem(t *testing.T) { } if i.Name != "Item" || - i.Price != "22.99" || - i.Currency != "GBP" || - i.Quantity != 1 { + i.Quantity != "1" { t.Errorf("Item decoded result is incorrect, Given: %v", i) } }