diff --git a/integration_test.go b/integration_test.go index bc3a573..6249f05 100644 --- a/integration_test.go +++ b/integration_test.go @@ -188,7 +188,7 @@ func TestCreatePayment(t *testing.T) { ItemList: &ItemList{ Items: []Item{ Item{ - Quantity: 2, + Quantity: "2", Price: "3.50", Currency: "USD", Name: "Product 1", @@ -251,7 +251,7 @@ func TestPatchPayment(t *testing.T) { ItemList: &ItemList{ Items: []Item{ Item{ - Quantity: 2, + Quantity: "2", Price: "3.50", Currency: "USD", Name: "Product 1", diff --git a/types.go b/types.go index dbfa546..f22109a 100644 --- a/types.go +++ b/types.go @@ -288,7 +288,7 @@ type ( // Item struct Item struct { - Quantity int `json:"quantity"` + Quantity string `json:"quantity"` Name string `json:"name"` Price string `json:"price"` Currency string `json:"currency"` diff --git a/unit_test.go b/unit_test.go index bbfd71c..7062ad8 100644 --- a/unit_test.go +++ b/unit_test.go @@ -59,7 +59,7 @@ func TestTypeItem(t *testing.T) { "name":"Item", "price":"22.99", "currency":"GBP", - "quantity":1 + "quantity":"1" }` i := &Item{} @@ -71,7 +71,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) } }