public bool Execute(CreditAuthorizationContext context) { context.ReservationId = _gateway.ReserveCredit( context.CreditCardNumber, context.Amount); return(context.ReservationId != Guid.Empty); }
public bool Execute(CreditAuthorizationContext context) { context.AuthToken = _gateway.CompleteTransaction( context.CreditCardNumber, context.ReservationId); return(context.AuthToken != String.Empty); }
public bool Execute(CreditAuthorizationContext context) { try { return(_gateway.ValidateCard(context.CreditCardNumber)); } catch (InvalidOperationException) { return(false); } }
public bool PerformFullCreditProcess( string cardNumber, decimal amount, out string authToken) { var context = new CreditAuthorizationContext { CreditCardNumber = cardNumber, Amount = amount }; foreach (var step in _steps) { if (!step.Execute(context)) { break; } } authToken = context.AuthToken; return(false); }