Skip to content

Swe 24 show pending transactions and allow cancel #16

Merged
merged 9 commits into from Apr 9, 2019

SWE-24 keep transaction variable

- we need to have the transaction locally so we can pass its members to our API to cancel payment
- added outlet for cancel button
  • Loading branch information
ahm11003 committed Apr 9, 2019
commit 71e5caf742fc09bd2343321a82ad4e135f809c5d
@@ -14,7 +14,9 @@ class TransactionDetailsInterfaceController: WKInterfaceController {
@IBOutlet var dateLabel: WKInterfaceLabel!
@IBOutlet var amountLabel: WKInterfaceLabel!
@IBOutlet var cancelButton: WKInterfaceButton!
var transaction: Transaction?
var account: Account?

override func awake(withContext context: Any?) {
super.awake(withContext: context)

@@ -29,13 +31,16 @@ class TransactionDetailsInterfaceController: WKInterfaceController {
}

setTitle("Dismiss")
self.transaction = transaction
account = acct
transactionName.setText(merchant)
dateLabel.setText("Date: \(DateFormatter.localizedString(from: date, dateStyle: .short, timeStyle: .none))")
amountLabel.setText(String(format: "Amount: $%.2f", amount))
cancelButton.setHidden(!transaction.isModifiable)
}

@IBAction func cancelButtonTapped() {
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.