Welcome to Dapi

Here you will find comprehensive documentation to help you integrate with Dapi's API as quickly as possible, as well as support if you get stuck. Get started below!

Get Started    

SDK Client (iOS)

This guide will show you how to integrate DapiConnect SDK for iOS and use its components to interact with the API.

Overview

Introduction

DapiConnect for iOS is a prebuilt SDK that reduces the time it takes to integrate with Dapi's API and gain access to your users financial data.

The SDK provides direct access to Dapi endpoints and offers optional UI to manage users' accounts, subaccounts, balance and money transfer.

Requirements

Before you start

Currently, the SDK is only available through CocoaPods.
To start integrating with DapiConnect.framework complete the following steps:

  1. Update your Podfile to include the following:
pod 'DapiConnect'
  1. Run the following command in your project directory:
pod install

How it works

DapiConnect SDK communicates with API endpoints to make network requests.
Requests do NOT go to Dapi servers directly. Instead, requests first go to your server and then to Dapi servers.

Why?
This is a security feature that keeps control in your hands. Your server is responsible for maintaining access tokens by creating, storing, and refreshing them.

See the example gif below:

Sample Request Flow

📘

Note

Dapi also provides a DapiConnect Server.

Integration

DapiConnect SDK can be integrated with the following steps:

  1. Import DapiConnect in your app delegate
import DapiConnect
  1. Add the following to your app delegate's applicationDidFinishLaunching(_:)
var urlComponents = URLComponents()
    urlComponents.scheme = "https"
    urlComponents.host = <#YourServerURL#>
    
    let configurations = DPCConfigurations()
    configurations.environment = .sandbox
    configurations.baseUrl = urlComponents

    DPCApp.setAppKey(<#AppKey#>, configurations: configurations)

📘

Note

You can get your app token from here

  1. If you're NOT using the SDK-Server:
    We provide an SDK for your server so DapiConnect-iOS can talk to it. By default, DapiConnect-iOS talks to the endpoints specified in the Requests and Responses section of this documentation.

If your custom implementation in your server exposes different endpoint naming than the mentioned in Requests and Responses , you'll need to pass the endpoints to DPCConfigurations's endpoint property.

var endpoints: [DPCEndPoint: String]

Components

DapiConnect consists of 3 core classes: DPCConnect, DPPayment and DPAutoFlow.

DPCConnect

Responsible for showing list of banks, credentials input, authorization and authentication. You can receive callbacks by assigning your class to its connectDelegate property.

let connect = DPCConnect()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        connect.connectDelegate = self
        connect.presentFlow(self)
        
    }

    // MARK: - Connect delegate methods.
    func connectDidSuccessfullyConnectToBank(withId bankId: String, connectionToken token: String) {
        print("✅")
    }
    
    func connectDidFailConnectingToBank(withId bankId: String) {
        print("🚩")
    }

DPPayment

You can call data and payment endpoints on a DPPayment object. Please note that DPCPayment only accepts a valid accessID as an initialization parameter.

This class has a required delegate method which will be called after the user submits an amount to send.

📘

Notes

DPCPayment only accepts a valid connection token as an initialization parameter.

let payment = DPCPayment(connectionToken: "1234")!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        payment.delegate = self
        payment.presentFlowOver(self)
        
    }
    
    func paymentNeedsMFAPresentedViewController(_ payment: DPCPayment) -> UIViewController {
        return self.presentedViewController ?? self
    }
    
    func paymentDidSubmitAmount(_ amount: Double, usingConnectionToken connectionToken: String) {
        
    }

DPAutoFlow

This component is the autopilot that lifts all the heavy work for you. It will display a list of connected accounts and give users the ability to connect additional accounts, remove existing accounts, see balance, and initiate payments.

It has a required delegate method that asks for beneficiary info needed to make a transfer.

let autoflow = DPCAutoFlow()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        autoflow.connectDelegate = self
        autoflow.paymentDelegate = self
        autoflow.autoflowDelegate = self
        autoflow.start()
    }
    
    func autoFlow(_ autoFlow: DPCAutoFlow, beneficiaryInfoForBankID bankID: String, supportsCreateBeneficiary: Bool) -> DPCBeneficiaryInfo {
        let beneficiary = DPCBeneficiaryInfo()
        // see `DPCBeneficiaryInfo` for more
        return beneficiary
    }

Updated about a month ago

SDK Client (iOS)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.