From c1e6da7a6f295364ebc961a44a6768f7de1ccff7 Mon Sep 17 00:00:00 2001 From: Bobbie Hodgetts Date: Wed, 17 Apr 2024 13:52:50 +0100 Subject: [PATCH] tidying up --- bnhtrade.sln | 42 +-------- .../Services/FbaInventoryService.cs | 2 +- .../AmazonMWS/Product/GetMyFeeEstimate.cs | 88 ------------------- 3 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 src/bnhtrade.Core/Data/AmazonMWS/Product/GetMyFeeEstimate.cs diff --git a/bnhtrade.sln b/bnhtrade.sln index c02a1f8..c6ded27 100644 --- a/bnhtrade.sln +++ b/bnhtrade.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.202 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CF330C30-8231-4D54-B60C-FF0644713502}" ProjectSection(SolutionItems) = preProject @@ -18,18 +18,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bnhtrade.ComTypeLib", "src\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{3D90C0F5-02E7-44E5-A89D-F5E217C6602F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MWSClientCsRuntime", "..\..\AmazonMWSCsClient\src\MWSClientCsRuntime\MWSClientCsRuntime.csproj", "{BDE52371-CAD4-4809-B8F7-9A218EE02464}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FBAInboundServiceMWS", "..\..\AmazonMWSCsClient\src\FBAInboundServiceMWS\FBAInboundServiceMWS.csproj", "{9C7D6775-4F06-4881-87A0-B9514F2F3033}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarketplaceWebServiceProducts", "..\..\AmazonMWSCsClient\src\MarketplaceWebServiceProducts\MarketplaceWebServiceProducts.csproj", "{FE2FE872-F92E-4B47-BCC2-E41B9C10EB96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MWSFinancesService", "..\..\AmazonMWSCsClient\src\MWSFinancesService\MWSFinancesService.csproj", "{1FE13EF5-AABF-4080-B790-990B9069C634}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MarketplaceWebService", "..\..\AmazonMWSCsClient\src\MarketplaceWebService\MarketplaceWebService.csproj", "{52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AmazonMWS", "AmazonMWS", "{09C5A59A-8917-4D5C-BA80-D38B8C9EDECC}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AmazonSPAPI", "AmazonSPAPI", "{897E06A7-7754-4AD6-B86B-BBEC63219DD1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FikaAmazonAPI", "src\Amazon-SP-API-CSharp\Source\FikaAmazonAPI\FikaAmazonAPI.csproj", "{062F6655-E065-4489-85E3-9AC979A27A61}" @@ -54,26 +42,6 @@ Global {C3405E9D-B47A-4569-B6A3-BC9E7AA71EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3405E9D-B47A-4569-B6A3-BC9E7AA71EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3405E9D-B47A-4569-B6A3-BC9E7AA71EE5}.Release|Any CPU.Build.0 = Release|Any CPU - {BDE52371-CAD4-4809-B8F7-9A218EE02464}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDE52371-CAD4-4809-B8F7-9A218EE02464}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDE52371-CAD4-4809-B8F7-9A218EE02464}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDE52371-CAD4-4809-B8F7-9A218EE02464}.Release|Any CPU.Build.0 = Release|Any CPU - {9C7D6775-4F06-4881-87A0-B9514F2F3033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C7D6775-4F06-4881-87A0-B9514F2F3033}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C7D6775-4F06-4881-87A0-B9514F2F3033}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C7D6775-4F06-4881-87A0-B9514F2F3033}.Release|Any CPU.Build.0 = Release|Any CPU - {FE2FE872-F92E-4B47-BCC2-E41B9C10EB96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE2FE872-F92E-4B47-BCC2-E41B9C10EB96}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE2FE872-F92E-4B47-BCC2-E41B9C10EB96}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE2FE872-F92E-4B47-BCC2-E41B9C10EB96}.Release|Any CPU.Build.0 = Release|Any CPU - {1FE13EF5-AABF-4080-B790-990B9069C634}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1FE13EF5-AABF-4080-B790-990B9069C634}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FE13EF5-AABF-4080-B790-990B9069C634}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1FE13EF5-AABF-4080-B790-990B9069C634}.Release|Any CPU.Build.0 = Release|Any CPU - {52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2}.Release|Any CPU.Build.0 = Release|Any CPU {062F6655-E065-4489-85E3-9AC979A27A61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {062F6655-E065-4489-85E3-9AC979A27A61}.Debug|Any CPU.Build.0 = Debug|Any CPU {062F6655-E065-4489-85E3-9AC979A27A61}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -87,12 +55,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {BDE52371-CAD4-4809-B8F7-9A218EE02464} = {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} - {9C7D6775-4F06-4881-87A0-B9514F2F3033} = {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} - {FE2FE872-F92E-4B47-BCC2-E41B9C10EB96} = {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} - {1FE13EF5-AABF-4080-B790-990B9069C634} = {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} - {52B09E65-F1B4-4B99-B8E2-4A0B2E3201C2} = {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} - {09C5A59A-8917-4D5C-BA80-D38B8C9EDECC} = {3D90C0F5-02E7-44E5-A89D-F5E217C6602F} {897E06A7-7754-4AD6-B86B-BBEC63219DD1} = {3D90C0F5-02E7-44E5-A89D-F5E217C6602F} {062F6655-E065-4489-85E3-9AC979A27A61} = {897E06A7-7754-4AD6-B86B-BBEC63219DD1} {6910D79E-0368-44C9-9A62-6EBEFFC54BA6} = {897E06A7-7754-4AD6-B86B-BBEC63219DD1} diff --git a/src/Amazon-SP-API-CSharp/Source/FikaAmazonAPI/Services/FbaInventoryService.cs b/src/Amazon-SP-API-CSharp/Source/FikaAmazonAPI/Services/FbaInventoryService.cs index 68810a3..4d08155 100644 --- a/src/Amazon-SP-API-CSharp/Source/FikaAmazonAPI/Services/FbaInventoryService.cs +++ b/src/Amazon-SP-API-CSharp/Source/FikaAmazonAPI/Services/FbaInventoryService.cs @@ -36,7 +36,7 @@ namespace FikaAmazonAPI.Services return list; } - private GetInventorySummariesResponse GetInventorySummariesByNextToken(string nextToken, ParameterGetInventorySummaries parameterGetInventorySummaries) + private GetInventorySummariesResponse GetInventorySummariesByNextToken(string nextToken,ParameterGetInventorySummaries parameterGetInventorySummaries) { parameterGetInventorySummaries.nextToken = nextToken; var param = parameterGetInventorySummaries.getParameters(); diff --git a/src/bnhtrade.Core/Data/AmazonMWS/Product/GetMyFeeEstimate.cs b/src/bnhtrade.Core/Data/AmazonMWS/Product/GetMyFeeEstimate.cs deleted file mode 100644 index 82d69f0..0000000 --- a/src/bnhtrade.Core/Data/AmazonMWS/Product/GetMyFeeEstimate.cs +++ /dev/null @@ -1,88 +0,0 @@ -using MarketplaceWebServiceProducts.Model; -using System; -using System.Collections.Generic; -using System.Threading; - -namespace bnhtrade.Core.Data.AmazonMWS.Product -{ - public class GetMyFeeEstimate - { - public List GetProductEstimateFee(FeesEstimateRequestList requestList) - { - var returnList = new List(); - if (requestList == null || !requestList.IsSetFeesEstimateRequest()) - { - return returnList; - } - else if (returnList.Count > 20) - { - throw new Exception("Max number of FeesEstimateRequest in one request is 20"); - } - - CredentialMws cred = new CredentialMws(); - var mwsProduct = new Data.AmazonMWS.Service();// AmazonMwsProduct(); - MarketplaceWebServiceProducts.MarketplaceWebServiceProducts service = mwsProduct.MarketplaceProducts(); - - // Create a request. - GetMyFeesEstimateRequest request = new GetMyFeesEstimateRequest(); - request.SellerId = cred.MerchantId; - request.MWSAuthToken = "example"; - //FeesEstimateRequestList requestList = new FeesEstimateRequestList(); - - //foreach (var item in itemList) - //{ - // string idType; - // if (item.IdValueIsAsin) { idType = "ASIN"; } - // else { idType = "SellerSku"; } - - // requestList.FeesEstimateRequest.Add(new FeesEstimateRequest - // { - // MarketplaceId = item.marketPlaceId, - // IdType = idType, - // IdValue = item.IdValue, - // PriceToEstimateFees = new PriceToEstimateFees - // { - // ListingPrice = new MoneyType { Amount = item.listingPrice, CurrencyCode = item.currencyCode }, - // //Shipping = new MoneyType { Amount = 3.5M, CurrencyCode = "GBP" }, - // //Points = new Points { PointsNumber = 0 } - // }, - // Identifier = "request_" + Guid.NewGuid().ToString(), - // IsAmazonFulfilled = true - // }); - //} - request.FeesEstimateRequestList = requestList; - - // define the list - GetMyFeesEstimateResult result = new GetMyFeesEstimateResult(); - //List resultList = new List(); - - try - { - int count = 0; - do - { - GetMyFeesEstimateResponse response = service.GetMyFeesEstimate(request); - if (response.IsSetGetMyFeesEstimateResult()) - { - result = response.GetMyFeesEstimateResult; - FeesEstimateResultList resultList = result.FeesEstimateResultList; - - List fees = resultList.FeesEstimateResult; - - return fees; - } - else - { - Thread.Sleep(500); - count++; - } - } while (count < 60); // 30 second timout - throw new Exception("Response timeout"); - } - catch - { - throw; - } - } - } -}