/// <summary>
        /// Update price for offer by id. The flow is designed to facilitate the planned offering of bundle discounts. This is not yet available. Therefore, the ‘quantity’ field should always contain the value ‘1’, and the price should represent the single unit price.
        /// </summary>
        /// <param name="offerId">Unique identifier for an offer.</param>
        /// <param name="pricing">New pricing for the offer.</param>
        /// <returns></returns>
        public async Task <StatusResponse> UpdateOfferPrice(string offerId, PricingContainer pricing)
        {
            var pricingContainer = new UpdatePriceContainer(pricing);

            using (var content = BolApiHelper.BuildContentFromObject(pricingContainer))
            {
                var response = await Put($"/offers/{offerId}/price", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
示例#2
0
        public async Task UpdateOfferPrice()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var bundlePrices = new List <BundlePrice>()
            {
                new BundlePrice(1, 6.55m)
            };
            var pricing    = new PricingContainer(bundlePrices);
            var firstOffer = openOffers.First();
            var result     = await bolApiCaller.Offers.UpdateOfferPrice(firstOffer.OfferId.ToString(), pricing);

            Assert.IsTrue(result.Description == "Update price for offer with id 4ae7a221-65e7-a333-e620-3f8e1caab5c3.");
        }
示例#3
0
        public async Task CreateOffer()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var condition    = new Condition(ConditionName.GOOD);
            var bundlePrices = new List <BundlePrice>
            {
                new BundlePrice(1, 5.55m)
            };
            var pricing     = new PricingContainer(bundlePrices);
            var stock       = new Stock(5, false);
            var fulfilment  = new SmallFulfilment(FulFilmentMethod.FBB);
            var createOffer = new CreateOffer("9789492493804", condition, pricing, stock, fulfilment)
            {
                Reference = "Test-Api"
            };
            var result = await bolApiCaller.Offers.CreateNewOffer(createOffer);

            Assert.IsTrue(result.Description == "Create an offer with ean 9789492493804.");
        }
 public UpdatePriceContainer(PricingContainer pricing)
 {
     Pricing = pricing;
 }