Ejemplo n.º 1
0
        public void SelectPaymentOption(PaymentOption paymentOption)
        {
            _paymentOption = paymentOption;
            string items = string.Join(",", _cartItems.Select(s => s.Name));

            _asActivityLogger.Log("Checkout", new Dictionary <string, string>
            {
                { "Name", "Tom" },
                { "Address", _address },
                { "Items", items },
                { "Payment", _paymentOption.ToString() }
            });
        }
Ejemplo n.º 2
0
        public void Pay()
        {
            Console.WriteLine($"Your order item(s) { string.Join(",", _cartItems.Select(s => s.Name))} has been placed.");
            Console.WriteLine($"To Address : {_address}");
            Console.WriteLine($"Payment Option : {_paymentOption}");
            var archiveMessage = new Dictionary <string, string>
            {
                { "Ordered Items", string.Join(",", _cartItems.Select(s => s.Name)) },
                { "To Address ", _address },
                { "Payment Option", _paymentOption.ToString() }
            };

            _asActivityLogger.Archive(JsonConvert.SerializeObject(archiveMessage));
        }