TangerineDownloader
public class TangerineDownloader
Class to download accounts and transactions from Tangerine
This class uses a webscraper to login. Your delegate needs to provide a view to add the webview to, as well as the otp the user received during the login attempt.
-
Delegate for the TangerineDownloader
Declaration
Swift
public weak var delegate: TangerineDownloaderDelegate?
-
Creates an instance of the TangerineDownloader
Declaration
Swift
public init()
-
Logs into the Tangerine website and requests the accounts
Note: If you want to call this function multiple times, be aware that it will request a view every time
Declaration
Swift
public func authorizeAndGetAccounts(username: String, pin: String, _ completion: @escaping (Result<[[String : Any]], Error>) -> Void)
Parameters
username
Tangerine website username / Login ID
pin
Tangerine website / online banking PIN
completion
completion handler - receives Result with an array containing the account info
-
Downloads the transactions for accounts
Note: you need to call this function after
authorizeAndGetAccounts
as only this one adds the webview to the view from the delegateDeclaration
Swift
public func downloadAccountTransactions(accounts: [String : [String : Any]], dateToLoadFrom: Date) -> Result<[String : [[String : Any]]], Error>
Parameters
accounts
dictionary of accounts to load. Mapping from account name to the JSON received from
authorizeAndGetAccounts
dateToLoadFrom
Date which will be passed to the API as start date to load transactions
Return Value
completion handler which returns a Result with the account names mapped to and array of transaction JSONs