-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaidHTTPClient.h
More file actions
61 lines (47 loc) · 2.79 KB
/
PlaidHTTPClient.h
File metadata and controls
61 lines (47 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// PlaidHTTPClient.h
// EnvelopeBudget
//
// Created by Nate on 5/29/14.
// Copyright (c) 2014 Nate. All rights reserved.
//
//You must import AFNetworking for this helper class to function.
//AFNetworking can be found on GitHub or at http://afnetworking.com
//Because of AFNetworking, all GET / POST methods to Plaid are done in the background
#import "AFHTTPSessionManager.h"
@interface PlaidHTTPClient : AFHTTPSessionManager
#define kPlaidBaseURL @"https://tartan.plaid.com"
+ (PlaidHTTPClient *)sharedPlaidHTTPClient;
//Downloads all avalailble institutions available from Plaid.
- (void)downloadPlaidInstitutionsWithCompletionHandler: (void(^)(NSArray * institutions))handler;
//Logins into a specific institution from Plaid with user credentials.
//Pin can be nil. Not all institutions require a pin.
- (void)loginToInstitution: (NSString *)institutionType
userName: (NSString *)userName
password: (NSString *)password
pin: (NSString *)pin
email: (NSString *)email
withCompletionHandler: (void(^)(NSInteger responseCode, NSDictionary *userAccounts))handler;
- (void)submitMFAResponse: (NSString *)mfaResponse
institution: (NSString *)institutionType
accessToken: (NSString *)accessToken
withCompletionHandler: (void(^)(NSInteger responseCode, NSDictionary *userAccounts))handler;
//Used to download transactions from a specific institution (accessToken).
//Pending, account, sinceTransaction, get, lte are all option. Set to nil if not desired option
- (void) downloadTransactionsForAccessToken: (NSString *)accessToken
pending: (BOOL) isPending
account: (NSString *)accountID
sinceTransaction: (NSString *)transactionID
gte: (NSDate *)fromDate
lte: (NSDate *)toDate
success: (void(^)(NSURLSessionDataTask *task, NSArray * transactions))handler
failure: (void(^)(NSURLSessionDataTask *task, NSError *error))handler;
//Gets details for specific account
- (void)downloadAccountDetailsForAccessToken: (NSString *)accessToken
account: (NSString *)accountID
success: (void(^)(NSURLSessionDataTask *task, NSDictionary *accountDetails))success
failure: (void(^)(NSURLSessionDataTask *task, NSError *error))failure;
- (void)downloadPlaidEntity: (NSString *)entityID
success: (void(^)(NSURLSessionDataTask *task, id plaidEntity))success
failure: (void(^)(NSURLSessionDataTask *task, NSError *error))failure;
@end