コード例 #1
0
        public string SubmitOrderFulfillmentFeed(FileStream feedContent)
        {
            if (feedContent == null)
            {
                return(null);
            }

            var feedResponse = _amazonFeedsApiService.SubmitFeed(AmazonFeedType._POST_ORDER_FULFILLMENT_DATA_, feedContent);

            return(feedResponse.FeedSubmissionId);
        }
コード例 #2
0
        public string SubmitCloseRequest(AmazonSyncModel model, FileStream productFeedContent)
        {
            var submissionId  = String.Empty;
            var uploadSuccess = false;
            var retryCount    = 0;

            while (!uploadSuccess)
            {
                retryCount++;
                if (retryCount == 3)
                {
                    AmazonProgressBarHelper.Update(model.Task, "Error",
                                                   "Request timed out. Please check logs for potential errors and try again later.", 100,
                                                   100);
                    break;
                }

                try
                {
                    AmazonProgressBarHelper.Update(model.Task, "Push", "Pushing request to Amazon", 100, 0);
                    var feedResponse = _amazonFeedsApiService.SubmitFeed(AmazonFeedType._POST_PRODUCT_DATA_, productFeedContent);
                    submissionId = feedResponse.FeedSubmissionId;
                    AmazonProgressBarHelper.Update(model.Task, "Push", "Request pushed to Amazon", 100, 75);

                    uploadSuccess = true;
                }
                catch (Exception ex)
                {
                    _amazonLogService.Add(AmazonLogType.Listings, AmazonLogStatus.Error, ex, null,
                                          AmazonApiSection.Feeds, null, null, null, null, "Error during push of product delete request to Amazon");

                    Thread.Sleep(120000);
                }
            }
            return(submissionId);
        }