Client-Side Implementation
Availability
SEPA Direct Debit is available to eligible merchants using a custom client-side integration. It is only available in Android v4.13+, iOS v5.11+, and JavaScript v3 SDK. It's not currently available in Drop-in.
If you meet the criteria, Contact us to enable SEPA Direct Debit in your Sandbox or Production account.
Set up your iOS Client
Get the SDK
Cocoapods
    Include Braintree/SEPADirectDebit in your Podfile:
    - Ruby
# Podfile
pod 'Braintree/SEPADirectDebit'Swift Package Manager
    Include the BraintreeSEPADirectDebit framework.
    Carthage
    Include the BraintreeCoreand BraintreeSEPADirectDebit frameworks.
    Collect information
    Once your component is ready, collect the required bank account information from the customer. Bank
    information:
    - accountHolderName (the name of the account owner)
- iban (International Bank Account Number)
- billingAddress
- customerID (customer id in the merchant's system)
Invoking the SEPA Direct Debit flow
    Construct a BTSEPADirectDebitClient and a BTSEPADirectDebitRequest. Call BTSEPADirectDebitClient.tokenize(_:completion:) to launch the SEPA Direct Debit flow.
    This method will create a mandate, display the mandate to the user, and tokenize the payment method.
    - Swift
class ExampleViewController: UIViewController {
  var apiClient: BTAPIClient!
  var sepaDebitClient: BTSEPADirectDebitClient!
  override func viewDidLoad() {
    super.viewDidLoad()
    self.apiClient = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")
    self.sepaDirectDebitClient = BTSEPADirectDebitClient(apiClient: apiClient)
  }
  func sepaDirectDebitButtonTapped() {
    let billingAddress = BTPostalAddress()
    billingAddress.recipientName = "John Doe"
    billingAddress.streetAddress = "123 Main St"
    billingAddress.countryCodeAlpha2 = "NL"
    billingAddress.locality = "Amsterdam"
    billingAddress.postalCode = "1072 AE"
    let sepaDirectDebitRequest = BTSEPADirectDebitRequest()
    sepaDirectDebitRequest.accountHolderName = "John Doe"
    sepaDirectDebitRequest.customerID = "1234"
    sepaDirectDebitRequest.iban = "FR7618106000321234566666608"
    sepaDirectDebitRequest.mandateType = .oneOff
    sepaDirectDebitRequest.address = billingAddress
    sepaDirectDebitClient.tokenize(sepaDirectDebitRequest) {
      sepaDirectDebitNonce, error in
      if let sepaDirectDebitNonce {
        // send sepaDirectDebitNonce.nonce to server
      } else if let error {
        // handle error
      } else {
        // handle cancel
      }
    }
  }
}