Exemplo n.º 1
0
        /// <summary>
        /// Basic Authentication Test against sales channel service endpoint
        /// </summary>
        /// <remarks>Add your details to the App.Config File</remarks>
        public static void TestSalesChannelAuth()
        {
            string        sBrandId = ConfigurationManager.AppSettings.Get("BrandID");
            SalesChannels sc       = new SalesChannels();

            CloudCommercePro.SalesChannels.RequestObjectOfString request = new CloudCommercePro.SalesChannels.RequestObjectOfString();
            request.BrandID      = int.Parse(sBrandId);
            request.SecurityHash = GetSecurityHash();
            request.Content      = sBrandId;

            CloudCommercePro.SalesChannels.ResponseObjectOfBoolean response = sc.SalesChannelClient.TestCredentials(request);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retreive a lis of active sales channels
        /// </summary>
        public static void GetActiveSalesChannels()
        {
            string        sBrandId = ConfigurationManager.AppSettings.Get("BrandID");
            SalesChannels sc       = new SalesChannels();

            CloudCommercePro.SalesChannels.RequestObjectOfInt32 request = new CloudCommercePro.SalesChannels.RequestObjectOfInt32();
            request.BrandID      = int.Parse(sBrandId);
            request.SecurityHash = GetSecurityHash();
            request.Content      = request.BrandID;

            CloudCommercePro.SalesChannels.ResponseObjectOfListOfAPISalesChannel channels = sc.SalesChannelClient.getActiveSalesChannels(request);

            if (channels.Content != null && channels.Content.Any())
            {
                foreach (var salesChannel in channels.Content)
                {
                    Console.WriteLine(string.Format("ID: {0} Name : {1} Channel Type: {1} Country : {2}", salesChannel.ID, salesChannel.Name, salesChannel.Type, salesChannel.Country));
                }

                Console.ReadKey();
            }
        }