private void loadSiteRelatedDetailsForSite(SiteCodeType site) { GeteBayDetailsResponseType resp = makeApiCall(_siteRelatedDetailNames, site); _taxJurisdictionDetails = resp.TaxJurisdiction; _shippingServiceDetails = resp.ShippingServiceDetails; _regionDetails = resp.RegionDetails; loadPaymentOptionsDetailsForSite(resp, site); loadURLDetailsForSite(resp, site); loadTaxJurisdictionDetailsForSite(resp, site); loadShippingServiceDetailsForSite(resp, site); loadRegionDetailsForSite(resp, site); }
//get eBay details response public GeteBayDetailsResponseType GetEbayDetails() { if (!siteEBayDetailsTable.ContainsKey(apiContext.Site)) { DetailsDownloader downloader = new DetailsDownloader(apiContext); GeteBayDetailsResponseType response = downloader.GeteBayDetails(); siteEBayDetailsTable.Add(apiContext.Site, response); return(response); } else { return(siteEBayDetailsTable[apiContext.Site] as GeteBayDetailsResponseType); } }
private void loadSiteIndependentDetails() { GeteBayDetailsResponseType resp = makeApiCall(_siteIndependentDetailNames, _apiContext.Site); _countryDetails = resp.CountryDetails; loadCountryDetails(_countryDetails); _currencyDetails = resp.CurrencyDetails; loadCurrencyDetails(_currencyDetails); _dispatchTimeMaxDetails = resp.DispatchTimeMaxDetails; loadDispatchTimeMaxDetails(_dispatchTimeMaxDetails); _shippingLocationDetails = resp.ShippingLocationDetails; loadShippingLocationDetails(_shippingLocationDetails); _siteDetails = resp.SiteDetails; loadSiteDetails(_siteDetails); _timeZoneDetails = resp.TimeZoneDetails; loadTimeZoneDetails(_timeZoneDetails); }
private void loadPaymentOptionsDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if (resp == null) { List <DetailNameCodeType> detailNames = new List <DetailNameCodeType>(new DetailNameCodeType[] { DetailNameCodeType.PaymentOptionDetails }); resp = makeApiCall(detailNames, site); } List <PaymentOptionDetailsType> details = resp.PaymentOptionDetails; if (details != null) { _PaymentOptionDetailsBySite.Add(site, details); Hashtable detailsByPaymentMethodMap = new Hashtable(); for (int i = 0; i < details.Count; i++) { PaymentOptionDetailsType detail = details[i]; detailsByPaymentMethodMap.Add(detail.PaymentOption, detail); } _PaymentOptionDetailsMapsBySite.Add(site, detailsByPaymentMethodMap); } }
private void loadURLDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if (resp == null) { List <DetailNameCodeType> detailNames = new List <DetailNameCodeType>(new DetailNameCodeType[] { DetailNameCodeType.URLDetails }); resp = makeApiCall(detailNames, site); } List <URLDetailsType> urlDetails = resp.URLDetails; if (urlDetails != null) { _URLDetailsBySite.Add(site, urlDetails); Hashtable detailsByURLTypeMap = new Hashtable(); for (int i = 0; i < urlDetails.Count; i++) { URLDetailsType detail = urlDetails[i]; detailsByURLTypeMap.Add(detail.URLType, detail); } _URLDetailsMapsBySite.Add(site, detailsByURLTypeMap); } }
public static void GetEbayDetailsRequest() { eBayAPIInterfaceService service = EbayCalls.EbayServiceCall("GetEbayDetails"); GeteBayDetailsRequestType request = new GeteBayDetailsRequestType(); request.Version = "949"; request.DetailName = new DetailNameCodeTypeCollection { DetailNameCodeType.ReturnPolicyDetails }; GeteBayDetailsResponseType response = service.GeteBayDetails(request); Console.WriteLine("================"); Console.WriteLine("Ebay request Details"); Console.WriteLine("================"); Console.WriteLine("Ack: {0}", response.Ack); Console.WriteLine("Version: {0}", response.Version); Console.WriteLine("Build: {0}", response.Build); }
//populate shipping service list private void populateShippingServiceComboBox() { this.shippingServiceComboBox.Items.Clear(); GeteBayDetailsResponseType eBayDetails = this.controller.SiteFacade.GetEbayDetails(); if (eBayDetails != null) { if (this.controller.ApiContext.Site == SiteCodeType.eBayMotors) { ListItem item = new ListItem(); item.Name = "None"; item.Value = "None"; this.shippingServiceComboBox.Items.Add(item); } ShippingServiceDetailsTypeCollection shippingDetails = eBayDetails.ShippingServiceDetails; if (shippingDetails != null) { foreach (ShippingServiceDetailsType shippingDetail in shippingDetails) { if (shippingDetail.ServiceType.Contains(ShippingTypeCodeType.Flat) && shippingDetail.ShippingServiceID < 5000) { ListItem item = new ListItem(); item.Name = shippingDetail.Description; item.Value = shippingDetail.ShippingService.ToString(); this.shippingServiceComboBox.Items.Add(item); } } } if (this.shippingServiceComboBox.Items.Count > 0) { this.shippingServiceComboBox.SelectedIndex = 0; } } }
private void loadTaxJurisdictionDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if (resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[] { DetailNameCodeType.TaxJurisdiction }); resp = makeApiCall(detailNames, site); } TaxJurisdictionTypeCollection details = resp.TaxJurisdiction; if (details != null) { _TaxJurisdictionDetailsBySite.Add(site, details); Hashtable detailsByJurisdictionIDMap = new Hashtable(); for (int i = 0; i < details.Count; i++) { TaxJurisdictionType detail = details[i]; detailsByJurisdictionIDMap.Add(detail.JurisdictionID, detail); } _TaxJurisdictionDetailsMapsBySite.Add(site, detailsByJurisdictionIDMap); } }
private void loadShippingServiceDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if (resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[] { DetailNameCodeType.ShippingServiceDetails }); resp = makeApiCall(detailNames, site); } ShippingServiceDetailsTypeCollection details = resp.ShippingServiceDetails; if (details != null) { _ShippingServiceDetailsBySite.Add(site, details); Hashtable detailsByShippingServiceIDMap = new Hashtable(); for (int i = 0; i < details.Count; i++) { ShippingServiceDetailsType detail = details[i]; detailsByShippingServiceIDMap.Add(detail.ShippingServiceID, detail); } _ShippingServiceDetailsMapsBySite.Add(site, detailsByShippingServiceIDMap); } }
private void loadRegionDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if (resp == null) { List <DetailNameCodeType> detailNames = new List <DetailNameCodeType>(new DetailNameCodeType[] { DetailNameCodeType.RegionDetails }); resp = makeApiCall(detailNames, site); } List <RegionDetailsType> details = resp.RegionDetails; if (details != null) { _RegionDetailsBySite.Add(site, details); Hashtable detailsByRegionIDMap = new Hashtable(); for (int i = 0; i < details.Count; i++) { RegionDetailsType detail = details[i]; detailsByRegionIDMap.Add(detail.RegionID, detail); } _RegionDetailsMapsBySite.Add(site, detailsByRegionIDMap); } }
private void populateShipToLocationTable() { this.shipToLocationTableLayoutPanel.Controls.Clear(); GeteBayDetailsResponseType eBayDetails = this.controller.SiteFacade.GetEbayDetails(); if (eBayDetails != null) { ShippingLocationDetailsTypeCollection locations = eBayDetails.ShippingLocationDetails; if (locations != null) { foreach (ShippingLocationDetailsType location in locations) { CheckBox cb = new CheckBox(); cb.AutoSize = true; cb.Text = location.Description; cb.Name = location.ShippingLocation; this.shipToLocationTableLayoutPanel.Controls.Add(cb); } } } }
private void populateReturnPolicy() { this.controller.ShowPleaseWaitDialog(); GeteBayDetailsResponseType ebayDetails = controller.SiteFacade.GetEbayDetails(); this.controller.HidePleaseWaitDialog(); if (ebayDetails == null) { this.returnPolicyGroupBox.Enabled = false; return; } ReturnsAcceptedDetailsTypeCollection returnsAcceptedCol = ebayDetails.ReturnPolicyDetails.ReturnsAccepted; RefundDetailsTypeCollection refundCol = ebayDetails.ReturnPolicyDetails.Refund; ReturnsWithinDetailsTypeCollection returnsWithinCol = ebayDetails.ReturnPolicyDetails.ReturnsWithin; ShippingCostPaidByDetailsTypeCollection costPaidByCol = ebayDetails.ReturnPolicyDetails.ShippingCostPaidBy; if (returnsAcceptedCol != null && returnsAcceptedCol.Count > 0) { this.returnAcceptedComboBox.Items.Clear(); foreach (ReturnsAcceptedDetailsType accept in returnsAcceptedCol) { ListItem item = new ListItem(); item.Name = accept.Description; item.Value = accept.ReturnsAcceptedOption; returnAcceptedComboBox.Items.Add(item); returnAcceptedComboBox.SelectedIndex = 0; } } else { this.returnAcceptedLabel.Enabled = false; this.returnAcceptedComboBox.Enabled = false; } if (refundCol != null && refundCol.Count > 0) { this.refundTypeComboBox.Items.Clear(); foreach (RefundDetailsType refund in refundCol) { ListItem item = new ListItem(); item.Name = refund.Description; item.Value = refund.RefundOption; refundTypeComboBox.Items.Add(item); refundTypeComboBox.SelectedIndex = 0; } } else { this.refundTypeLabel.Enabled = false; this.refundTypeComboBox.Enabled = false; } if (returnsWithinCol != null && returnsWithinCol.Count > 0) { this.returnWithinComboBox.Items.Clear(); foreach (ReturnsWithinDetailsType within in returnsWithinCol) { ListItem item = new ListItem(); item.Name = within.Description; item.Value = within.ReturnsWithinOption; returnWithinComboBox.Items.Add(item); returnWithinComboBox.SelectedIndex = 0; } } else { this.ReturnWithinLabel.Enabled = false; this.returnWithinComboBox.Enabled = false; } if (costPaidByCol != null && costPaidByCol.Count > 0) { this.shippingCostPaidByComboBox.Items.Clear(); foreach (ShippingCostPaidByDetailsType cost in costPaidByCol) { ListItem item = new ListItem(); item.Name = cost.Description; item.Value = cost.ShippingCostPaidByOption; shippingCostPaidByComboBox.Items.Add(item); shippingCostPaidByComboBox.SelectedIndex = 0; } } else { this.shippingCostPaidByLabel.Enabled = false; this.shippingCostPaidByComboBox.Enabled = false; } }
private void loadPaymentOptionsDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if(resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[]{DetailNameCodeType.PaymentOptionDetails}); resp = makeApiCall(detailNames, site); } PaymentOptionDetailsTypeCollection details = resp.PaymentOptionDetails; if(details != null) { _PaymentOptionDetailsBySite.Add(site, details); Hashtable detailsByPaymentMethodMap = new Hashtable(); for(int i = 0; i < details.Count; i++) { PaymentOptionDetailsType detail = details[i]; detailsByPaymentMethodMap.Add(detail.PaymentOption, detail); } _PaymentOptionDetailsMapsBySite.Add(site, detailsByPaymentMethodMap); } }
private void loadShippingServiceDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if(resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[] {DetailNameCodeType.ShippingServiceDetails}); resp = makeApiCall(detailNames, site); } ShippingServiceDetailsTypeCollection details = resp.ShippingServiceDetails; if(details != null) { _ShippingServiceDetailsBySite.Add(site, details); Hashtable detailsByShippingServiceIDMap = new Hashtable(); for(int i = 0; i < details.Count; i++) { ShippingServiceDetailsType detail = details[i]; detailsByShippingServiceIDMap.Add(detail.ShippingServiceID, detail); } _ShippingServiceDetailsMapsBySite.Add(site, detailsByShippingServiceIDMap); } }
public ResultInfoEbayDetails(GeteBayDetailsResponseType response) : base(response) { _Response = response; }
public void GeteBayDetails() { GeteBayDetailsCall api = new GeteBayDetailsCall(this.apiContext); DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll }; api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels); // Call API. api.Execute(); GeteBayDetailsResponseType resp = api.ApiResponse; Assert.IsNotNull(resp.CountryDetails); Assert.IsTrue(resp.CountryDetails.Count > 0); Assert.IsNotNull(resp.CurrencyDetails); Assert.IsTrue(resp.CurrencyDetails.Count > 0); Assert.IsNotNull(resp.RegionDetails); Assert.IsTrue(resp.RegionDetails.Count > 0); Assert.IsNotNull(resp.SiteDetails); Assert.IsTrue(resp.SiteDetails.Count > 0); Assert.IsNotNull(resp.URLDetails); Assert.IsTrue(resp.URLDetails.Count > 0); Assert.IsNotNull(resp.PaymentOptionDetails); Assert.IsTrue(resp.PaymentOptionDetails.Count > 0); Assert.IsNotNull(resp.ReturnPolicyDetails != null); /////////////// // Testing EBayDetailsHelper /////////////// /////// // - Not site specific details: /////// EBayDetailsHelper helper = EBayDetailsHelper.getInstance(apiContext); CountryDetailsTypeCollection countryDetails = helper.getCountryDetails(); Assert.IsNotNull(countryDetails); CurrencyDetailsTypeCollection currencyDetails = helper.getCurrencyDetails(); Assert.IsNotNull(currencyDetails); DispatchTimeMaxDetailsTypeCollection dispatchTimeDetails = helper.getDispatchTimeMaxDetails(); Assert.IsNotNull(dispatchTimeDetails); ShippingLocationDetailsTypeCollection shippingLocations = helper.getShippingLocationDetails(); Assert.IsNotNull(shippingLocations); ShippingLocationDetailsType shipLocationDetailsType = helper.getShippingLocationDetailsByShipingLocation("AU"); Assert.AreEqual("Australia", shipLocationDetailsType.Description); SiteDetailsTypeCollection siteDetails = helper.getSiteDetails(); Assert.IsNotNull(siteDetails); TimeZoneDetailsTypeCollection timeZoneDetails = helper.getTimeZoneDetails(); Assert.IsNotNull(timeZoneDetails); //////// // - Site specific details: //////// /// Payment Option Details PaymentOptionDetailsTypeCollection paymentDetails1 = helper.getPaymentOptionDetailsForSite(SiteCodeType.US); Assert.IsNotNull(paymentDetails1); PaymentOptionDetailsType paymentOption = helper.getPaymentOptionDetailsBySiteAndPaymentMethod(SiteCodeType.US, BuyerPaymentMethodCodeType.Discover); Assert.IsNotNull(paymentOption); PaymentOptionDetailsTypeCollection paymentDetails2 = helper.getPaymentOptionDetailsForSite(SiteCodeType.UK); Assert.IsNotNull(paymentDetails2); PaymentOptionDetailsTypeCollection paymentDetails3 = helper.getPaymentOptionDetailsForSite(SiteCodeType.Canada); Assert.IsNotNull(paymentDetails3); // Tax Jurisdiction Details TaxJurisdictionTypeCollection taxCollectionDetails = helper.getTaxJurisdictionDetailsForSite(SiteCodeType.US); Assert.IsNotNull(taxCollectionDetails); TaxJurisdictionType taxJurisdictionType = helper.getTaxJurisdictionDetailsBySiteAndJurisdictionID(SiteCodeType.US, "WY"); Assert.AreEqual("Wyoming", taxJurisdictionType.JurisdictionName); // Region Details //commented by william, 3/15/2008 RegionDetailsTypeCollection regionDetails = helper.getRegionDetailsForSite(SiteCodeType.US); Assert.IsNotNull(regionDetails); RegionDetailsType regionDetail = helper.getRegionDetailsBySiteAndRegionID(SiteCodeType.US, "57"); Assert.AreEqual("CA-Oakland", regionDetail.Description); // Shipping Service Details ShippingServiceDetailsTypeCollection shippingServiceDetails = helper.getShippingServiceDetailsForSite(SiteCodeType.France); Assert.IsNotNull(shippingServiceDetails); ShippingServiceDetailsType shipServiceDetails = helper.getShippingServiceDetailsBySiteAndShippingServiceID(SiteCodeType.US, 8); //Assert.AreEqual("US Postal Service Parcel Post", shipServiceDetails.Description); // URL Details URLDetailsTypeCollection urlDetails = helper.getURLDetailsForSite(SiteCodeType.US); Assert.IsNotNull(urlDetails); URLDetailsType urlDetail = helper.getURLDetailsBySiteAndURLType(SiteCodeType.US, URLTypeCodeType.ViewUserURL); Assert.IsNotNull(urlDetail); }
private void loadTaxJurisdictionDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if(resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[] {DetailNameCodeType.TaxJurisdiction}); resp = makeApiCall(detailNames, site); } TaxJurisdictionTypeCollection details = resp.TaxJurisdiction; if(details != null) { _TaxJurisdictionDetailsBySite.Add(site, details); Hashtable detailsByJurisdictionIDMap = new Hashtable(); for(int i = 0; i < details.Count; i++) { TaxJurisdictionType detail = details[i]; detailsByJurisdictionIDMap.Add(detail.JurisdictionID, detail); } _TaxJurisdictionDetailsMapsBySite.Add(site, detailsByJurisdictionIDMap); } }
private void loadURLDetailsForSite(GeteBayDetailsResponseType resp, SiteCodeType site) { if(resp == null) { DetailNameCodeTypeCollection detailNames = new DetailNameCodeTypeCollection(new DetailNameCodeType[] {DetailNameCodeType.URLDetails}); resp = makeApiCall(detailNames, site); } URLDetailsTypeCollection urlDetails = resp.URLDetails; if(urlDetails != null) { _URLDetailsBySite.Add(site, urlDetails); Hashtable detailsByURLTypeMap = new Hashtable(); for(int i = 0; i < urlDetails.Count; i++) { URLDetailsType detail = urlDetails[i]; detailsByURLTypeMap.Add(detail.URLType, detail); } _URLDetailsMapsBySite.Add(site, detailsByURLTypeMap); } }