Esempio n. 1
0
        public override string GenerateShippingLabelFor(Order o)
        {
            var shippingCost = ShippingCostCalculator.GetCost(o.Recipient.Country, o.Sender.Country, o.TotalWeight);

            return($"Shipping Id: {$"SWE-{Guid.NewGuid()}" } {Environment.NewLine}" +
                   $"To: {o.Recipient.To} {Environment.NewLine}" +
                   $"Order total: {o.Total} {Environment.NewLine}" +
                   $"Tax: {TaxOptions} {Environment.NewLine}" +
                   $"Shipping Cost: {shippingCost}");
        }
Esempio n. 2
0
        public override string GenerateShippingLabelFor(Order o)
        {
            if (o.Recipient.Country != o.Sender.Country)
            {
                throw new NotSupportedException("International shipping not supported");
            }

            var shippingCost = ShippingCostCalculator.GetCost(o.Recipient.Country, o.Sender.Country, o.TotalWeight);

            return($"Shipping Id: AUS-{Guid.NewGuid()} {Environment.NewLine}" +
                   $"To: {o.Recipient.To} {Environment.NewLine}" +
                   $"Order total: {o.Total} {Environment.NewLine}" +
                   $"Tax: {TaxOptions} {Environment.NewLine}" +
                   $"Shipping Cost: {shippingCost}");
        }