Beispiel #1
0
        public ShippingResponse getShipping()
        {
            Settings settings = new Settings();
            FedExAuthentication auth = new FedExAuthentication {
                AccountNumber = Convert.ToInt32(settings.Get("FedExAccount")),
                Key = settings.Get("FedExKey"),
                Password = settings.Get("FedExPassword"),
                CustomerTransactionId = "",
                MeterNumber = Convert.ToInt32(settings.Get("FedExMeter"))
            };

            ShippingAddress destination = new ShippingAddress();
            destination = this.Shipping.getShipping();
            DistributionCenter d = new DistributionCenter().GetNearest(this.Shipping.GeoLocate());
            ShippingAddress origin = d.getAddress().getShipping();
            List<int> parts = new List<int>();
            foreach (CartItem item in this.CartItems) {
                for (int i = 1; i <= item.quantity; i++) {
                    parts.Add(item.partID);
                }
            }

            ShippingResponse response = CURTAPI.GetShipping(auth, origin, destination, parts);

            return response;
        }