public void InsertPayment(IPaymentProvider provider, string pin) { if (!provider.HasBalance()) { throw new Exception(String.Format("Cannot vend if balance is lower than {0}", provider.MinimumBalance)); } if (!provider.IsValidPin(pin)) { throw new Exception("Invalid Pin provided"); } ChangeState(); }