|
@@ -27,10 +27,22 @@ class PaymentDetailInterfaceController: WKInterfaceController { |
|
|
NSLog("Error getting account object and payment amount") |
|
|
return |
|
|
} |
|
|
|
|
|
FetchData.getBankInfo{ accts, error in guard error == nil else { |
|
|
NSLog("Error retrieving payment methods for account in paymentDetailInterfaceController.") |
|
|
return |
|
|
} |
|
|
|
|
|
self.dictForBankAcct.updateValue(accts, forKey: "paymentOptions") |
|
|
|
|
|
} |
|
|
self.paymentAmount = amount |
|
|
self.selectedAccount = acct |
|
|
paymentButton.setTitle(String(format: "Pay $%.2f", amount)) |
|
|
if let p1 = self.dictForBankAcct["paymentOptions"] { |
|
|
UserDefaults.standard.set(p1[0], forKey: "default_bank_acct") |
|
|
print("yes") |
|
|
self.detailButton.setTitle(p1[0].bankName) |
|
|
} |
|
|
} |
|
|
|
|
|
@IBAction func paymentAction() { |
|
@@ -47,20 +59,16 @@ class PaymentDetailInterfaceController: WKInterfaceController { |
|
|
} |
|
|
} |
|
|
|
|
|
@IBAction func bankAccountsTapped(){ |
|
|
FetchData.getBankInfo{ accts, error in guard error == nil else{ |
|
|
NSLog("Error retrieving payment methods for account in paymentDetailInterfaceController.") |
|
|
return |
|
|
} |
|
|
|
|
|
self.dictForBankAcct.updateValue(accts, forKey: "paymentOptions") |
|
|
self.pushController(withName: "PaymentOptions", context: self.dictForBankAcct) |
|
|
} |
|
|
@IBAction func bankAccountsTapped() { |
|
|
self.pushController(withName: "PaymentOptions", context: self.dictForBankAcct) |
|
|
} |
|
|
|
|
|
override func willActivate() { |
|
|
// This method is called when watch view controller is about to be visible to user |
|
|
super.willActivate() |
|
|
if let bankacct = UserDefaults.standard.value(forKey: "default_bank_acct") as? BankAcct { |
|
|
detailButton.setTitle(bankacct.bankName) |
|
|
} |
|
|
} |
|
|
|
|
|
override func didDeactivate() { |
|
|