Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SWE-12 handle web service call and prepare to push to payment result
  • Loading branch information
ahm11003 committed Mar 29, 2019
1 parent a2689bd commit 511f4f5
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -12,6 +12,7 @@ import Foundation
class PaymentDetailInterfaceController: WKInterfaceController {
var selectedAccount: Account?
var dictForAcct: [String: Account] = [:]
var dictForPayment: [String: String] = [:]
var paymentButtonArmed: Bool = false
var paymentAmount: Double = 0.0

Expand All @@ -34,6 +35,14 @@ class PaymentDetailInterfaceController: WKInterfaceController {
@IBAction func paymentAction() {
if paymentButtonArmed {
popToRootController()
guard let alias = selectedAccount?.accountAlias else { return }
FetchData.submitPayment(for: alias, type: "CBL", amount: 20.00, bankID: "9999") { confirmationNum, paymentID, error in
guard error == nil else { return }
self.dictForPayment.updateValue(confirmationNum, forKey: "payment_confirmation_number")
self.dictForPayment.updateValue(paymentID, forKey: "payment_id")
}

// popToRootController()
} else {
// animate(withDuration: 0.75) {
// self.paymentButton.setBackgroundColor(UIColor.init(red: 141, green: 241, blue: 48, alpha: 1.0))
Expand Down

0 comments on commit 511f4f5

Please sign in to comment.