Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into SWF-17-credit-health
# Conflicts:
#	SynchronyFinancial/SynchronyFinancial WatchKit Extension/FetchData.swift
#	SynchronyFinancial/SynchronyFinancial.xcodeproj/project.pbxproj
  • Loading branch information
ahm11003 committed Apr 17, 2019
2 parents 23fb930 + 8d33cc1 commit 80acdbf
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 48 deletions.
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14490.70" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Qge-pO-HLc">
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14460.31" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Qge-pO-HLc">
<device id="watch38" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="watchOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14490.21"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14460.16"/>
</dependencies>
<scenes>
<!--root-->
Expand Down Expand Up @@ -219,13 +219,16 @@
<objects>
<controller id="t8d-XB-ngB" customClass="PaymentDetailInterfaceController" customModule="SynchronyFinancial_WatchKit_App" customModuleProvider="target">
<items>
<imageView alignment="left" hidden="YES" id="qfi-KI-QXK"/>
<label width="1" alignment="center" hidden="YES" text="Processing ..." textAlignment="center" id="kgd-iG-og7"/>
<imageView alignment="left" hidden="YES" id="jH5-mg-vuQ"/>
<label width="1" alignment="center" hidden="YES" text="Processing ..." textAlignment="center" id="YNm-eO-7xL"/>
<group width="1" height="1" alignment="left" layout="vertical" id="9VF-fb-CV3">
<items>
<label width="1" alignment="center" text="Pay From:" textAlignment="center" id="xE5-Zl-U7d"/>
<button width="1" height="40" alignment="left" title="Synchrony (1234)" id="SZD-0B-PrF" userLabel="detailButton">
<button width="1" height="40" alignment="left" title="Select Bank" id="SZD-0B-PrF" userLabel="detailButton">
<fontDescription key="font" type="system" pointSize="15"/>
<connections>
<action selector="bankAccountsTapped" destination="t8d-XB-ngB" id="bQR-Mu-nB6"/>
</connections>
</button>
<separator alignment="left" verticalAlignment="center" id="et0-Sq-Qxm">
<color key="color" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand All @@ -242,17 +245,48 @@
</group>
</items>
<connections>
<outlet property="activityIndicator" destination="qfi-KI-QXK" id="wVj-x3-NzV"/>
<outlet property="activityIndicatorLabel" destination="kgd-iG-og7" id="csx-e2-1eZ"/>
<outlet property="activityIndicator" destination="jH5-mg-vuQ" id="ucI-rB-ebj"/>
<outlet property="activityIndicatorLabel" destination="YNm-eO-7xL" id="okk-cx-k3L"/>
<outlet property="amount" destination="mT0-3D-JGP" id="rff-wG-B82"/>
<outlet property="contentGroup" destination="9VF-fb-CV3" id="vfa-YT-ipt"/>
<outlet property="detailButton" destination="SZD-0B-PrF" id="xEw-gE-yIP"/>
<outlet property="payFrom" destination="xE5-Zl-U7d" id="62t-6n-KSD"/>
<outlet property="paymentButton" destination="FgU-iZ-2XU" id="yZe-dZ-nBV"/>
<outlet property="separate" destination="et0-Sq-Qxm" id="JfK-S7-H9d"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1085" y="186"/>
</scene>
<!--PaymentOptions-->
<scene sceneID="T56-bi-gCI">
<objects>
<controller identifier="PaymentOptions" id="jbp-Bi-Bk7" userLabel="PaymentOptions" customClass="PaymentOptionsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<table alignment="left" id="RJQ-am-qV6" userLabel="Banks Table">
<items>
<tableRow identifier="bankAcctCell" id="Mfw-7m-ih3" customClass="BankAcctCell" customModule="SynchronyFinancial_WatchKit_Extension">
<group key="rootItem" width="1" height="43" alignment="left" layout="vertical" id="8u2-82-z5f">
<items>
<label width="136" alignment="left" text="Bank Name" id="y0D-7u-Qtr" userLabel="Bank Name Label"/>
<label width="58" height="20" alignment="left" text="(1234)" id="FMl-Jx-r2b" userLabel="last4 Label"/>
</items>
</group>
<connections>
<outlet property="bankNameLabel" destination="y0D-7u-Qtr" id="5Ao-39-aie"/>
<outlet property="last4Label" destination="FMl-Jx-r2b" id="w7N-Dp-fkz"/>
</connections>
</tableRow>
</items>
</table>
</items>
<connections>
<outlet property="bankAcctTable" destination="RJQ-am-qV6" id="mjy-8f-Qzt"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1400" y="186"/>
</scene>
<!--PaymentResult-->
<scene sceneID="mFc-oM-oG1">
<objects>
Expand All @@ -271,7 +305,7 @@
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1408" y="185"/>
<point key="canvasLocation" x="1400" y="516"/>
</scene>
<!--Transactions-->
<scene sceneID="yXO-yR-k6b">
Expand Down Expand Up @@ -300,34 +334,66 @@
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1085" y="-229"/>
<point key="canvasLocation" x="1085" y="-233"/>
</scene>
<!--TransactionDetails-->
<scene sceneID="aqX-eB-bdU">
<objects>
<controller identifier="TransactionDetails" id="LeA-fL-4Wb" customClass="TransactionDetailsInterfaceController" customModule="SynchronyFinancial_WatchKit_App" customModuleProvider="target">
<items>
<label width="1" alignment="center" text="Scheduled Online Payment Processing" textAlignment="center" numberOfLines="2" minimumScaleFactor="0.69999999999999996" id="z1i-je-74F">
<fontDescription key="font" type="boldSystem" pointSize="15"/>
</label>
<separator alignment="left" id="HuQ-dl-7Ni"/>
<group width="1" height="105" alignment="left" verticalAlignment="center" layout="vertical" id="EcM-m6-j4G">
<imageView alignment="left" hidden="YES" id="579-gg-q4m"/>
<label width="1" alignment="left" verticalAlignment="center" hidden="YES" text="Cancelling..." textAlignment="center" id="fN3-48-fyV"/>
<group width="1" alignment="left" layout="vertical" id="w3k-a5-ZaU">
<items>
<label width="1" alignment="center" verticalAlignment="center" text="Label" textAlignment="center" id="F4A-wp-ECw"/>
<label width="1" alignment="center" verticalAlignment="center" text="Label" textAlignment="center" id="d4y-NP-GbP"/>
<button width="1" alignment="center" verticalAlignment="bottom" title="Cancel Payment" id="4Rt-Xc-Vdh"/>
<label width="1" alignment="center" text="Scheduled Online Payment Processing" textAlignment="center" numberOfLines="2" minimumScaleFactor="0.69999999999999996" id="z1i-je-74F">
<fontDescription key="font" type="boldSystem" pointSize="15"/>
</label>
<separator alignment="left" id="HuQ-dl-7Ni"/>
<group width="1" height="105" alignment="left" verticalAlignment="center" layout="vertical" id="EcM-m6-j4G">
<items>
<label width="1" alignment="center" verticalAlignment="center" text="Label" textAlignment="center" id="F4A-wp-ECw"/>
<label width="1" alignment="center" verticalAlignment="center" text="Label" textAlignment="center" id="d4y-NP-GbP"/>
<button width="1" alignment="center" verticalAlignment="bottom" title="Cancel Payment" id="4Rt-Xc-Vdh">
<connections>
<action selector="cancelButtonTapped" destination="LeA-fL-4Wb" id="OZd-NZ-CFc"/>
</connections>
</button>
</items>
</group>
</items>
</group>
</items>
<connections>
<outlet property="activityIndicator" destination="579-gg-q4m" id="9r5-DE-Ise"/>
<outlet property="activityIndicatorLabel" destination="fN3-48-fyV" id="gy3-Ci-bwx"/>
<outlet property="amountLabel" destination="d4y-NP-GbP" id="WOU-uA-pCu"/>
<outlet property="cancelButton" destination="4Rt-Xc-Vdh" id="TLc-0k-RFv"/>
<outlet property="contentGroup" destination="w3k-a5-ZaU" id="rQo-G8-l7A"/>
<outlet property="dateLabel" destination="F4A-wp-ECw" id="J5W-xg-g3R"/>
<outlet property="transactionName" destination="z1i-je-74F" id="i76-Qo-iL9"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1420" y="-229"/>
<point key="canvasLocation" x="1400" y="-233"/>
</scene>
<!--Cancellation-->
<scene sceneID="ZZZ-KP-exO">
<objects>
<controller identifier="Cancellation" id="Cwl-i7-4Od" customClass="CancellationInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="center" text="Cancellation Result:" textAlignment="center" numberOfLines="2" id="UKx-cb-xBx">
<fontDescription key="font" type="boldSystem" pointSize="15"/>
</label>
<separator alignment="left" id="9Q6-wJ-WvP"/>
<label width="1" alignment="center" text="Confirmation Number:" textAlignment="center" minimumScaleFactor="0.69999999999999996" id="YZm-kP-QEl"/>
<label width="1" alignment="center" text="Label" textAlignment="center" id="mS7-FX-NiH"/>
</items>
<connections>
<outlet property="confirmationLabel" destination="mS7-FX-NiH" id="HNE-E7-kF1"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1722" y="-229"/>
</scene>
<!--UtilizationScore-->
<scene sceneID="nMW-YM-Pwh">
Expand Down Expand Up @@ -373,6 +439,6 @@
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="AFS-lo-piH"/>
<segue reference="kTV-Eb-cpT"/>
</inferredMetricsTieBreakers>
</document>
Expand Up @@ -12,7 +12,7 @@ import Foundation
class AccountDetailsInterfaceController: WKInterfaceController {
var selectedAccount: Account?
var dictForAcct: [String: Account] = [:]
var transactionDict: [String: [Transaction]] = [:]
var transactionDict: [String: Any] = [:]

@IBOutlet var loadingLabel: WKInterfaceLabel!
@IBOutlet var activityIndicator: WKInterfaceImage!
Expand Down Expand Up @@ -41,6 +41,9 @@ class AccountDetailsInterfaceController: WKInterfaceController {
return
}

if let acct = self.selectedAccount {
self.transactionDict.updateValue(acct, forKey: "acct")
}
self.transactionDict.updateValue(transactions, forKey: "transactions")
self.pushController(withName: "Transactions", context: self.transactionDict)
self.configureInterfaceObjects(false)
Expand Down
@@ -0,0 +1,15 @@
//
// BankAcctCell.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Rahul Kantesaria on 4/5/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import Foundation
import WatchKit

class BankAcctCell: NSObject {
@IBOutlet weak var bankNameLabel: WKInterfaceLabel!
@IBOutlet weak var last4Label: WKInterfaceLabel!
}
@@ -0,0 +1,34 @@
//
// CancellationInterfaceController.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 4/8/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import WatchKit
import Foundation

class CancellationInterfaceController: WKInterfaceController {
@IBOutlet var confirmationLabel: WKInterfaceLabel!

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

guard let data = context as? [String: String], let confirmation = data["cancellation_confirm"] else {
NSLog("Error receiving context for payment cancellation")
return
}

setTitle("Done")
confirmationLabel.setText(confirmation)
}

override func willActivate() {
super.willActivate()
}

override func didDeactivate() {
super.didDeactivate()
}
}
Expand Up @@ -98,7 +98,6 @@ class FetchData {
let modifiable = $0["is_payment_modifiable"].string {
let type: TransactionType = $0["payment_amount_type"].stringValue == "" ? .purchase : .reimbursement
let isModifiable: Bool = modifiable == "Y" ? true : false

transactions.append(Transaction(type: type, amount: amount, merchantID: desc, date: date, confirmationNum: confirmationNum, paymentId: paymentId, isPending: true, isModifiable: isModifiable, transactionCode: transactionCode))
}
}
Expand Down Expand Up @@ -133,11 +132,10 @@ class FetchData {
//"fetch_bank_account_details"
dict["fetch_bank_account_details"]?.arrayValue.forEach {
if let bankId = $0["bank_account_id"].string,
let accttype: AccountType = $0["bank_account_type"].stringValue ==
"C" ? .checkings : .savings {
//print(bankId)
//print(accttype)
bankIds.append(BankAcct(bankAcctId: bankId, acctType: accttype))
let bankName = $0["bank_name"].string,
let last4Acct = $0["last4_bank_acct_number"].string,
let accttype: AccountType = AccountType(rawValue: $0["bank_account_type"].stringValue) {
bankIds.append(BankAcct(bankAcctId: bankId, acctType: accttype, bankName: bankName, last4Acct: last4Acct))
}
}
completion(bankIds, nil)
Expand All @@ -153,7 +151,6 @@ class FetchData {
paymentHeader["account_alias"] = accountAlias
paymentHeader["payment_confirmation_number"] = confirmationNum
paymentHeader["payment_id"] = paymentId

Alamofire.request(Defaults.CANCEL_PAYMENT_URL, method: .post, parameters: paymentHeader, encoding: JSONEncoding.default, headers: Defaults.authHeader).responseJSON { payload in
switch payload.result {
case .success(let value):
Expand Down

0 comments on commit 80acdbf

Please sign in to comment.