public static CreditCard Create(CreditCardType type, string number, string owner, ExpiryDate expiration) { var card = new CreditCard {Type = type, Owner = owner, Number = number, Expires = expiration}; return card; }
public void SaveCheckoutInformation(ShoppingCart orderRequest, Address address, CreditCard card) { orderRequest.Buyer.SetAddress(address); orderRequest.Buyer.SetPaymentDetails(card); _customerRepository.Save(orderRequest.Buyer); }
/// <summary> /// Set the payment details of the customer (e.g., credit card number) /// </summary> /// <param name="card">Credit card used for payment</param> /// <returns>this instance</returns> public Customer SetPaymentDetails(CreditCard card) { if (card != null) Payment = card; return this; }