public double CancelPurchase() { SelectedProduct = null; var change = CoinsEntered.Sum(); CoinsEntered.Clear(); TransactionState = TransactionState.StandBy; return(change); }
private PurchaseResult HandlePurchase() { TransactionState = TransactionState.InProgress; var result = ProcessPurchase(CoinsEntered.ToArray()); if (result != null && result.AmountDue >= 0) { TransactionState = TransactionState.StandBy; } return(result); }
public PurchaseResult InsertCoin(double coin) { CoinsEntered.Add(coin); return(HandlePurchase()); }