change type of Item.Amount from string to int to get it working with the newest PayPal API

This commit is contained in:
Jonathan Weber 2017-01-27 15:00:29 +01:00
parent 7b764347d0
commit 13492e99b9
2 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ type (
// Item struct // Item struct
Item struct { Item struct {
Quantity string `json:"quantity"` Quantity int `json:"quantity"`
Name string `json:"name"` Name string `json:"name"`
Price string `json:"price"` Price string `json:"price"`
Currency string `json:"currency"` Currency string `json:"currency"`

View File

@ -36,7 +36,7 @@ func TestTypeItem(t *testing.T) {
"name":"Item", "name":"Item",
"price":"22.99", "price":"22.99",
"currency":"GBP", "currency":"GBP",
"quantity":"1" "quantity":1
}` }`
i := &Item{} i := &Item{}
@ -48,7 +48,7 @@ func TestTypeItem(t *testing.T) {
if i.Name != "Item" || if i.Name != "Item" ||
i.Price != "22.99" || i.Price != "22.99" ||
i.Currency != "GBP" || i.Currency != "GBP" ||
i.Quantity != "1" { i.Quantity != 1 {
t.Errorf("Item decoded result is incorrect, Given: %v", i) t.Errorf("Item decoded result is incorrect, Given: %v", i)
} }
} }