2013-05-30 70 views
1

我正在使用eBay SOAP SDK示例。我正在嘗試添加訂單,但它要求我提供一個交易ID。我如何獲得交易ID?我輸入了數字1,表示找不到它。我今天剛剛註冊,我的商店是空的。eBay SDK添加訂單交易ID

 private void BtnAddOrder_Click(object sender, System.EventArgs e) 
    { 
     try 
     { 
      TxtOrderId.Text = ""; 

      AddOrderCall apicall = new AddOrderCall(Context); 


      OrderType order = new OrderType(); 
      order.TransactionArray = new TransactionTypeCollection(); 
      order.ShippingDetails = new ShippingDetailsType(); 
      order.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection(); 

      TransactionType tr1 = new TransactionType(); 
      tr1.Item = new ItemType(); 
      tr1.Item.ItemID = TxtItemIdOne.Text; 
      tr1.TransactionID = TxtTransactionIdOne.Text; 
      order.TransactionArray.Add(tr1); 

      TransactionType tr2 = new TransactionType(); 
      tr2.Item = new ItemType(); 
      tr2.Item.ItemID = TxtItemIdTwo.Text; 
      tr2.TransactionID = TxtTransactionIdTwo.Text; 
      order.TransactionArray.Add(tr2); 

      order.ShippingDetails.PaymentInstructions = TxtPaymentInstructions.Text; 
      ShippingServiceOptionsType shpopt = new ShippingServiceOptionsType(); 
      shpopt.ShippingService = CboShipSvc.SelectedItem.ToString(); 
      shpopt.ShippingServicePriority = 1; 

      order.ShippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(); 
      shpopt.ShippingServiceCost = new AmountType(); 
      shpopt.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site); 

      if (TxtShipCost.Text.Length > 0) 
      { 
       shpopt.ShippingServiceCost.Value = Convert.ToDouble(TxtShipCost.Text); 
      } 
      order.ShippingDetails.ShippingServiceOptions.Add(shpopt); 

      order.Total = new AmountType(); 
      order.Total.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site); 
      if (TxtTotal.Text.Length > 0) 
       order.Total.Value = Convert.ToDouble(TxtTotal.Text); 
      order.CreatingUserRole = (TradingRoleCodeType) Enum.Parse(typeof(TradingRoleCodeType), CboRole.SelectedItem.ToString()); 

      order.PaymentMethods.AddRange(new BuyerPaymentMethodCodeType[] {BuyerPaymentMethodCodeType.PaymentSeeDescription}); 

      string orderid = apicall.AddOrder(order); 


      TxtOrderId.Text = orderid; 

     } 
     catch(Exception ex) 
     { 
      MessageBox.Show(ex.Message); 
     } 

    } 

回答

1

此調用用於加入兩個訂單,以便買方可以一起付款。 看到這個AddOrder Reference。 它要求您從商店的交易編號加入一個訂單。如果找不到交易ID,那麼您可能已經輸入了一個不存在的交易ID。在你的情況下,幾乎肯定是這樣。 (如果我沒有記錯的話,交易ID是9位數的字符串)。我想你要找的是這個,PlaceOffer Reference。 你將需要有一些項目,但。

好運與Ebay API。