From 13492e99b992b4c0dd2ef6f340eba4adcc019d15 Mon Sep 17 00:00:00 2001 From: Jonathan Weber Date: Fri, 27 Jan 2017 15:00:29 +0100 Subject: [PATCH] change type of Item.Amount from string to int to get it working with the newest PayPal API --- types.go | 2 +- types_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types.go b/types.go index 5e1b3ee..57cf090 100644 --- a/types.go +++ b/types.go @@ -193,7 +193,7 @@ type ( // Item struct Item struct { - Quantity string `json:"quantity"` + Quantity int `json:"quantity"` Name string `json:"name"` Price string `json:"price"` Currency string `json:"currency"` diff --git a/types_test.go b/types_test.go index 1a85eb6..3f87c13 100644 --- a/types_test.go +++ b/types_test.go @@ -36,7 +36,7 @@ func TestTypeItem(t *testing.T) { "name":"Item", "price":"22.99", "currency":"GBP", - "quantity":"1" + "quantity":1 }` i := &Item{} @@ -48,7 +48,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) } }