示例#1
0
        public async Task RequestExport()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Offers.RequestOfferExportFile();

            Assert.IsTrue(result.Description == "Create an offer export.");
        }
示例#2
0
        public async Task GetShipmentList()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Shipments.GetShipmentList(page : 1, fulFilmentType : FulFilmentMethod.FBR);

            Assert.IsTrue(response.Shipments.Length == 4);
        }
示例#3
0
        public async Task GetOpenOrders()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Orders.GetOpenOrders(1, FulFilmentMethod.FBR);

            Assert.IsTrue(response.Orders.Length > 0);
        }
        public async Task HandleReturn()
        {
            var api      = new BolApiCaller(testClientId, testClientSecret, true);
            var response = await api.Returns.HandleReturn(86129741, new HandleReturnContainer(1, HandlingResult.RETURN_DOES_NOT_MEET_CONDITIONS));

            Assert.IsTrue(response.EventType == "HANDLE_RETURN_ITEM");
        }
示例#5
0
        public async Task GetShipmentById()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Shipments.GetShipmentById("914587795");

            Assert.IsTrue(response.ShipmentReference == "Shipment1");
        }
示例#6
0
        public async Task AddTransportInformation()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Transports.AddTransportInformation("358612589", new ObjectDefinitions.Transport("TNT", "3SAOLD1234567"));

            Assert.IsTrue(response.EventType == "CHANGE_TRANSPORT");
        }
        public async Task GetReturns()
        {
            var api      = new BolApiCaller(testClientId, testClientSecret, true);
            var response = await api.Returns.GetReturns();

            Assert.IsTrue(response.Returns[0].ReturnItems[0].Ean == "0634154562956");
        }
        public async Task GetProcessStatusesByIds()
        {
            var api      = new BolApiCaller(testClientId, testClientSecret, true);
            var statuses = await api.ProcessStatus.GetProcessStatusesByIds(new [] { "1", "2" });

            Assert.IsTrue(statuses.ProcessStatuses[0].EventType == "CONFIRM_SHIPMENT");
        }
示例#9
0
        public async Task RetrieveOffer()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Offers.GetOffer("13722de8-8182-d161-5422-4a0a1caab5c8");

            Assert.IsTrue(result.Ean == "3165140085229");
        }
示例#10
0
        public async Task ShipOrder()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Orders.GetOpenOrders(1, FulFilmentMethod.FBR);

            var requestWasSend = false;

            foreach (var order in response.Orders)
            {
                foreach (var orderItem in order.OrderItems)
                {
                    var shippingInfo = new ShippingInfo();
                    shippingInfo.OrderItems = new List <OrderItemIdContainer>()
                    {
                        new OrderItemIdContainer()
                        {
                            OrderItemId = orderItem.OrderItemId
                        }
                    };
                    var shipmentResponse = await bolApiCaller.Orders.ShipOrderItem(shippingInfo);

                    requestWasSend = true;
                    Assert.IsTrue(shipmentResponse.EventType == "CONFIRM_SHIPMENT");
                    //The BOL api limits the amount of calls on this endpoint
                    await Task.Delay(100);
                }
            }

            Assert.IsTrue(requestWasSend);
            Assert.IsTrue(response.Orders.Length > 0);
        }
        public async Task GetProcessStatus()
        {
            var api    = new BolApiCaller(testClientId, testClientSecret, true);
            var status = await api.ProcessStatus.GetStatusByProcessId("1");

            Assert.IsTrue(status.EventType == "CONFIRM_SHIPMENT");
        }
        public async Task GetProcessStatusByEntityId()
        {
            var api    = new BolApiCaller(testClientId, testClientSecret, true);
            var status = await api.ProcessStatus.GetProcessStatusByEntityAndEvent("555551", ProcessEventType.CONFIRM_SHIPMENT);

            Assert.IsTrue(status.ProcessStatuses[0].EventType == "CONFIRM_SHIPMENT");
        }
示例#13
0
        public async Task RetrieveExport()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Offers.RetrieveOfferExportFile("73985e00-d461-4461-80e7-d3fea8d23ef4");

            Assert.IsTrue(result.StartsWith("offerId,ean,conditionName"));
        }
        public async Task GetCommissionByEANWithReduction()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var commission   = await bolApiCaller.Commissions.GetCommissionByEAN("8718526069334", "NEW", 25.00m);

            Assert.AreEqual(commission.Condition, "NEW");
        }
        public async Task GetCommissionByEANAsync()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var commission   = await bolApiCaller.Commissions.GetCommissionByEAN("8712626055143", "GOOD", 24.50m);

            Assert.AreEqual(commission.Condition, "GOOD");
        }
示例#16
0
        public async Task RetrieveUnpublishedOfferReport()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all This endpoint??");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Offers.RetrieveUnpublishedOfferReport("3f2bb9f5-79dd-472c-aeb7-fef416b77928");
        }
示例#17
0
        public async Task RequestUnpublishedOfferReport()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all This endpoint??");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Offers.RequestUnpublishedOfferReport();
        }
示例#18
0
        public async Task GetExport()
        {
            // Not done in test environment because it requires processing which is not supported in the test environment
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, false);
            var response     = await bolApiCaller.Offers.GetOfferExportFile();

            Assert.IsTrue(response.StartsWith("offerId,ean,conditionName,conditionCategory"));
        }
示例#19
0
        public async Task UpdateOfferStock()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var stock        = new Stock(15, false);
            var firstOffer   = openOffers.First();
            var result       = await bolApiCaller.Offers.UpdateOfferStock(firstOffer.OfferId.ToString(), stock);

            Assert.IsTrue(result.Description == "Update stock for offer with id 4ae7a221-65e7-a333-e620-3f8e1caab5c3.");
        }
        public async Task GetReturnByRMAId()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to expect a different content type, however this makes no sense..");

            var api      = new BolApiCaller(testClientId, testClientSecret, true);
            var response = await api.Returns.GetReturnByRMAId(86123452);

            Assert.IsTrue(response.Returns[0].ReturnItems[0].Ean == "8712626055150");
        }
示例#21
0
        public async Task GetRetailPricingInformationForEAN()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to expect a different content type, however this makes no sense..");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Pricing.GetRetailPricingInformationForEAN("0000007740404");

            Assert.IsTrue(result.RetailPrices.Count == 2);
        }
示例#22
0
        public async Task SendTestPushNotification()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all subscriptions??");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Subscriptions.SendTestPushNotification();

            Assert.IsTrue(result.EventType == "SEND_SUBSCRIPTION_TST_MSG");
        }
示例#23
0
        public async Task GetPushNotificationSubscriptions()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all subscriptions??");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Subscriptions.GetPushNotificationSubscriptions();

            Assert.IsTrue(result.Subscriptions[0].Id == 1234);
        }
示例#24
0
        public async Task GetPushNotificationSubscriptionById()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all subscriptions??");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Subscriptions.GetPushNotificationSubscriptionById(1234);

            Assert.IsTrue(result.Url == "https://www.example.com/push");
        }
        public async Task GetPurchasableShippingLabel()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to expect a different content type, however this makes no sense..");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.ShippingLabels.GetShippingLabelOrderItemId("6702312887");

            Assert.IsTrue(response.PurchasableShippingLabels.Length == 3);
        }
示例#26
0
        public async Task DeletePushNotificationSubscription()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to expect a different content type, however this makes no sense..");

            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var result       = await bolApiCaller.Subscriptions.DeletePushNotificationSubscription(1234);

            Assert.IsTrue(result.EventType == "DELETE_SUBSCRIPTION");
        }
示例#27
0
        public async Task UpdatePushNotificationSubscription()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to have deleted all subscriptions??");

            var bolApiCaller             = new BolApiCaller(testClientId, testClientSecret, true);
            var notificationSubscription = new CreateNotificationSubscription(new string[] { "PROCESS_STATUS" }, "https://www.test.com/test");
            var result = await bolApiCaller.Subscriptions.UpdatePushNotificationSubscription(1234, notificationSubscription);

            Assert.IsTrue(result.EventType == "UPDATE_SUBSCRIPTION");
        }
示例#28
0
        public async Task CreatePushNotificationSubscription()
        {
            //Remove if Bol fixed this issue
            Assert.Inconclusive("Bol seems to expect a different content type, however this makes no sense..");

            var bolApiCaller             = new BolApiCaller(testClientId, testClientSecret, true);
            var notificationSubscription = new CreateNotificationSubscription(new string[] { "PROCESS_STATUS" }, "https://www.test.com/test");
            var result = await bolApiCaller.Subscriptions.CreatePushNotificationSubscription(notificationSubscription);

            Assert.IsTrue(result.EventType == "CREATE_SUBSCRIPTION");
            Assert.IsTrue(result.Status == "PENDING");
        }
示例#29
0
        public async Task GetOrder()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var response     = await bolApiCaller.Orders.GetOpenOrders(1, FulFilmentMethod.FBR);

            foreach (var order in response.Orders)
            {
                var orderResponse = await bolApiCaller.Orders.GetOrder(order.OrderId);

                Assert.IsTrue(orderResponse.OrderItems.Length > 0);
            }
            Assert.IsTrue(response.Orders.Length > 0);
        }
示例#30
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.");
        }