Doing bank transfers in Swift with Plaid and Stripe iOS SDK

Following my previous article on implementing Stripe and in swift, let’s have a look on how we can make our payment system even more awesome by integrating Plaid. Plaid allows you, among a lot of other things, to get a customer’s bank account data, such as capturing payment information, authenticating accounts, and checking balances. It’s great if you want, for example, to do bank transfers, and it’s what we are going to implement right now.

We are going to use the Plaid ios sdk project, and Plaid Link which provides a visual interface to connect to the bank. So pick up our Stripe project, add pod ‘plaid-ios-sdk’  and pod ‘plaid-ios-link’ , and run pod install.

Next add the following in your bridging header:

#import <plaid_ios_sdk/Plaid-Swift.h>
#import <plaid_ios_link/plaid-ios-link-umbrella.h>

and add @import plaid_ios_sdk; @import plaid_ios_link; , so we don’t have to import Plaid on top of every file.

Next you will need to setup a Plaid account. You can do so on Stripe ACH docs page, just click on the blue setup plaid button in the middle left, and follow the instruction. If everything went well, you should see this appearing on your Plaid dashboard:


You’ll get a public key, which you then need to setup in your appdelegate:


You can then move to your storyboard, add a UIButton and connect it in your viewcontroller to trigger the presentation of the plaid bank picker view controller. Finally, make your view controller implements the Plaid Link protocol :

class ViewController: UIViewController, PLDLinkNavigationControllerDelegate

And add the following method in your view controller:

//MARK: -  PLAID Methods

@IBAction func plaidConnectButton(sender: AnyObject) {
        let plaidLink = PLDLinkNavigationViewController(environment: .Tartan, product: .Connect)
        plaidLink.linkDelegate = self
        plaidLink.providesPresentationContextTransitionStyle = true
        plaidLink.definesPresentationContext = true
        plaidLink.modalPresentationStyle = .Custom
        self.presentViewController(plaidLink, animated: true, completion: nil)
    func linkNavigationContoller(navigationController: PLDLinkNavigationViewController!, didFinishWithAccessToken accessToken: String!) {
        print("success \(accessToken)")
        self.dismissViewControllerAnimated(true, completion: nil)
    func linkNavigationControllerDidFinishWithBankNotListed(navigationController: PLDLinkNavigationViewController!) {
        print("Manually enter bank info?")
        self.dismissViewControllerAnimated(true, completion: nil)
    func linkNavigationControllerDidCancel(navigationController: PLDLinkNavigationViewController!) {
        self.dismissViewControllerAnimated(true, completion: nil)

If everything went well, you should see the following view appearing once you click on the Plaid button:


You can try it out by using the Plaid Link sandbox credentials, and testing on Citi, as others banks requires also pin or other forms of authentication:

username: plaid_test
password: plaid_good
It returns a token, which you can then send to Stripe to get an account ID back and process the payment in the backend.