From 511f4f578e7dcb7d4afc6571b31b0935652dedc1 Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Fri, 29 Mar 2019 18:42:06 -0400 Subject: [PATCH] SWE-12 handle web service call and prepare to push to payment result --- .../PaymentDetailInterfaceController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PaymentDetailInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PaymentDetailInterfaceController.swift index 30ed7b8..2be4347 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PaymentDetailInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/PaymentDetailInterfaceController.swift @@ -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 @@ -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))