From fff4ae06c1dddac29946fa9005173db1ea7b24a4 Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Thu, 4 Apr 2019 20:36:01 -0400 Subject: [PATCH] SWE-12 disable payment buttons in given situations - if the minimum payment due is $0, we disable the button to allow paying that amount - if the current account balance is $0, we disable the button to allow paying that amount --- .../PayBillInterfaceController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PayBillInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PayBillInterfaceController.swift index 3593120..5facc30 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PayBillInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PayBillInterfaceController.swift @@ -60,6 +60,9 @@ class PayBillInterfaceController: WKInterfaceController { let minimumFormatted = String(format: "$%.2f", valid.minPayDue) minimumLabel.setText("Minimum Payment:\n\(minimumFormatted)") payMinimumButton.setTitle("Pay \(minimumFormatted)") + + payMinimumButton.setEnabled(valid.minPayDue > 0.0) + payBalanceButton.setEnabled(valid.curBalance > 0.0) } } }