Ejemplo n.º 1
0
        /// <summary>makes the purchase of tickets</summary>
        /// <param name="model">Request</param>
        /// <exception cref="InvalidOperationException">Ocorre quando não há itens no pedido</exception>
        public void Buy(IBuyOnCard model)
        {
            var request = SaveRequest(model);
            var card    = new CardOfCredit(model);

            Buy(card, request, model.SaveCard);
        }
Ejemplo n.º 2
0
 public CardOfCredit(IBuyOnCard model) : this((IBuyOnClick)model)
 {
     CreditCardBrand  = model.CreditCardBrand;
     CreditCardNumber = model.CardNumber;
     ExpMonth         = model.ValidMonth;
     ExpYear          = model.ValidYear.ToString()
                        .Substring(2)
                        .ToInt32();
     HolderName       = model.Name;
     InstallmentCount = model.InstallmentCount;
     SecurityCode     = model.CardCvv.ToString();
 }
Ejemplo n.º 3
0
 /// <summary>makes the purchase of tickets</summary>
 /// <param name="model">Request</param>
 /// <exception cref="InvalidOperationException">Ocorre quando não há itens no pedido</exception>
 public Task BuyAsync(IBuyOnCard model)
 {
     return(Task.Factory.StartNew(() => Buy(model)));
 }
Ejemplo n.º 4
0
 /// <summary>makes the purchase of tickets</summary>
 /// <param name="model">Request</param>
 /// <exception cref="InvalidOperationException">Ocorre quando não há itens no pedido</exception>
 public Task BuyAsync(IBuyOnCard model)
 {
     return Task.Factory.StartNew(() => Buy(model));
 }
Ejemplo n.º 5
0
 /// <summary>makes the purchase of tickets</summary>
 /// <param name="model">Request</param>
 /// <exception cref="InvalidOperationException">Ocorre quando não há itens no pedido</exception>
 public void Buy(IBuyOnCard model)
 {
     var request = SaveRequest(model);
     var card = new CardOfCredit(model);
     Buy(card, request, model.SaveCard);
 }