Add CheckCompatibility and GetItemByGroupID

This commit is contained in:
JBP
2019-08-18 19:08:21 +02:00
parent 7484ba3df6
commit 345ff16666
7 changed files with 236 additions and 48 deletions
+1 -23
View File
@@ -9,7 +9,6 @@ import (
"net/http"
"net/url"
"os"
"strconv"
"strings"
"testing"
"time"
@@ -137,26 +136,5 @@ func TestAuction(t *testing.T) {
if err != nil && !ebay.IsError(err, ebay.ErrGetBiddingNoBiddingActivity) {
t.Fatalf("Expected error code %d, got %+v.", ebay.ErrGetBiddingNoBiddingActivity, err)
}
var bidValue, bidCurrency string
if len(bid.SuggestedBidAmounts) > 0 {
bidValue = bid.SuggestedBidAmounts[0].Value
bidCurrency = bid.SuggestedBidAmounts[0].Currency
} else {
bidValue = it.CurrentBidPrice.Value
v, err := strconv.ParseFloat(bidValue, 64)
if err != nil {
t.Fatal(err)
}
v += 2
bidValue = fmt.Sprintf("%.2f", v)
bidCurrency = it.CurrentBidPrice.Currency
}
_, err = client.Buy.Offer.PlaceProxyBid(ctx, it.ItemID, ebay.BuyMarketplaceUSA, bidValue, bidCurrency, false)
if err != nil {
t.Fatal(err)
}
t.Logf("Successfully bid %+v.", bid.SuggestedBidAmounts[0])
t.Logf("bidding: %+v", bid)
}