Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
1 parent 7ed54df commit 71e5caf
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 71e5caf

Please sign in to comment.