public DeliveryAddress(Domain.Model.OrderDeliveryAddress address) { this.Name = address.Name; this.Street = address.Street; this.Number = address.Number; this.Complement = address.Complement; this.District = address.District; this.City = address.City; this.State = address.State; this.ZipCode = address.ZipCode; this.Reference = address.Reference; this.Email = address.Email; this.HomePhone = address.HomePhone; this.CellPhone = address.CellPhone; }
public TicketGames.PagSeguro.Model.Credit MappingCredit(Domain.Model.Participant participant, Domain.Model.Cart cart, Domain.Model.OrderDeliveryAddress orderDeliveryAddress, TicketGames.Domain.Model.Credit credit) { TicketGames.PagSeguro.Model.Credit creditPagSeguro = new TicketGames.PagSeguro.Model.Credit(); // Add items foreach (var item in cart.CartItems) { creditPagSeguro.Items.Add(new TicketGames.PagSeguro.Model.Item() { ProductId = item.ProductId.ToString(), Product = item.Product.Name, Quantity = item.Quantity, Value = (45 / cart.CartItems.Count) }); } creditPagSeguro.OrderId = 33873647; creditPagSeguro.ShippingAddress = new TicketGames.PagSeguro.Model.ShippingAddress(); creditPagSeguro.ShippingAddress.Street = orderDeliveryAddress.Street; creditPagSeguro.ShippingAddress.Number = orderDeliveryAddress.Number; creditPagSeguro.ShippingAddress.Complement = orderDeliveryAddress.Complement; creditPagSeguro.ShippingAddress.District = orderDeliveryAddress.District; creditPagSeguro.ShippingAddress.ZipCode = orderDeliveryAddress.ZipCode; creditPagSeguro.ShippingAddress.City = orderDeliveryAddress.City; creditPagSeguro.ShippingAddress.State = orderDeliveryAddress.State; if (credit.Owner) { creditPagSeguro.BillingAddress = new TicketGames.PagSeguro.Model.BillingAddress(); creditPagSeguro.BillingAddress.Street = participant.Street; creditPagSeguro.BillingAddress.Number = participant.Number; creditPagSeguro.BillingAddress.Complement = participant.Complement; creditPagSeguro.BillingAddress.ZipCode = participant.ZipCode; creditPagSeguro.BillingAddress.District = participant.District; creditPagSeguro.BillingAddress.City = participant.City; creditPagSeguro.BillingAddress.State = participant.State; } creditPagSeguro.CreditCardHolder = new TicketGames.PagSeguro.Model.CreditCardHolder(); creditPagSeguro.CreditCardHolder.Name = participant.Name; creditPagSeguro.CreditCardHolder.CPF = participant.CPF; creditPagSeguro.CreditCardHolder.BirthDate = Convert.ToDateTime("21/05/1989"); creditPagSeguro.CreditCardHolder.DDD = "11"; creditPagSeguro.CreditCardHolder.Phone = "980203026"; creditPagSeguro.Buyer = new TicketGames.PagSeguro.Model.Buyer(); creditPagSeguro.SenderHash = credit.SenderHash; creditPagSeguro.Buyer.Name = participant.Name; creditPagSeguro.Buyer.CPF = participant.CPF; creditPagSeguro.Buyer.DDD = "11"; creditPagSeguro.Buyer.Phone = "980203026"; creditPagSeguro.Buyer.Mail = participant.Email; creditPagSeguro.CreditCardToken = credit.CreditCardToken; creditPagSeguro.Parcel = new TicketGames.PagSeguro.Model.Parcel(); creditPagSeguro.Parcel.Quantity = credit.Parcel; creditPagSeguro.Parcel.Value = credit.Value; creditPagSeguro.Brand = credit.Brand; creditPagSeguro.Owner = credit.Owner; creditPagSeguro.Session = credit.Session; return(creditPagSeguro); }
public TicketGames.PagSeguro.Model.Billet MappingBillet(Domain.Model.Participant participant, Domain.Model.OrderDeliveryAddress orderDeliveryAddress, TicketGames.Domain.Model.Billet billet) { TicketGames.PagSeguro.Model.Billet billetPagSeguro = new PagSeguro.Model.Billet(); billetPagSeguro.Price = billet.Value; billetPagSeguro.ShippingAddress = new TicketGames.PagSeguro.Model.ShippingAddress(); billetPagSeguro.ShippingAddress.Street = orderDeliveryAddress.Street; billetPagSeguro.ShippingAddress.Number = orderDeliveryAddress.Number; billetPagSeguro.ShippingAddress.Complement = orderDeliveryAddress.Complement; billetPagSeguro.ShippingAddress.District = orderDeliveryAddress.District; billetPagSeguro.ShippingAddress.ZipCode = orderDeliveryAddress.ZipCode; billetPagSeguro.ShippingAddress.City = orderDeliveryAddress.City; billetPagSeguro.ShippingAddress.State = orderDeliveryAddress.State; billetPagSeguro.Buyer = new TicketGames.PagSeguro.Model.Buyer(); billetPagSeguro.Session = billet.Session; billetPagSeguro.SenderHash = billet.SenderHash; billetPagSeguro.Buyer.Name = participant.Name; billetPagSeguro.Buyer.CPF = participant.CPF; billetPagSeguro.Buyer.DDD = "11"; billetPagSeguro.Buyer.Phone = "980203026"; billetPagSeguro.Buyer.Mail = participant.Email; return(billetPagSeguro); }