Example #1
0
        public void Ship()
        {
            // confirm shipping data
            if (String.IsNullOrWhiteSpace(ShippingAddress))
            {
                throw new ApplicationException("Invalid shipping address");
            }

            // get shipping label / id from UPS
            string shipmentNumber = UpsService.GetShipmentNumber();

            // print label
            PrinterService.PrintLabel(shipmentNumber);
        }
Example #2
0
        public static UpsServiceAggregate ToAggregate(this UpsService upsService)
        {
            if (upsService == null)
            {
                throw new ArgumentNullException(nameof(upsService));
            }

            return(new UpsServiceAggregate
            {
                Id = upsService.Id,
                CountryCode = upsService.CountryCode,
                Service = (UpsAggregateServices)upsService.Service
            });
        }
Example #3
0
 protected override string GetShippingLabel()
 {
     return(UpsService.GetShipmentNumber());
 }
 private string GetShippingLabel()
 {
     return(UpsService.GetShipmentNumber());
 }