我正在尝试在eBay SandBox中创建一些示例订单。首先,除了使用API之外,还有更简单的方法吗?我执行此代码时遇到此错误:
“你不能买自己的物品。”
GetUserCall getUserCall = new GetUserCall(Context);
UserType user = getUserCall.GetUser("TESTUSER_jmawebtech");
GetItemCall getItemCall = new GetItemCall(Context);
ItemType it = getItemCall.GetItem(textBox1.Text);
PlaceOfferCall apiCall = new PlaceOfferCall(Context);
OfferType offer = new OfferType();
offer.Action = BidActionCodeType.Bid;
offer.ItemID = textBox1.Text;
//offer.User = user;
offer.UserConsent = true;
offer.Quantity = 1;
offer.UserConsentSpecified = true;
offer.Message = "Bid successful!";
apiCall.ApiRequest.EndUserIP = "127.0.0.1";
offer.MaxBid = new AmountType { Value = Convert.ToDouble(textBox2.Text) };
//error happens here
SellingStatusType st = apiCall.PlaceOffer(offer, textBox1.Text);
如何使用其他用户创建项目?这是我的代码:
TxtItemId.Text = "";
TxtListingFee.Text = "";
ItemType item = FillItem();
AddItemCall apicall = new AddItemCall(Context);
if (ListPictures.Items.Count > 0)
{
apicall.PictureFileList = new StringCollection();
item.PictureDetails = new PictureDetailsType();
item.PictureDetails.PhotoDisplay = (PhotoDisplayCodeType) Enum.Parse(typeof(PhotoDisplayCodeType), CboPicDisplay.SelectedItem.ToString());
}
foreach (string pic in ListPictures.Items)
{
apicall.PictureFileList.Add(pic);
}
FeeTypeCollection fees = apicall.AddItem(item);
答案 0 :(得分:0)
创建一个虚拟用户。使用辅助电子邮件帐户。