forked from go-packages/paypal
change type of Item.Amount from string to int to get it working with the newest PayPal API
This commit is contained in:
parent
7b764347d0
commit
13492e99b9
2
types.go
2
types.go
|
@ -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"`
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user