Client-Side Implementation
Important
Starting November 2, 2026, CocoaPods will be officially deprecated as a supported installation method for the Braintree iOS SDK. After this date, Braintree will no longer provide updates or support for integrations that install the SDK via CocoaPods. Please migrate to Swift Package Manager (SPM) to continue receiving SDK updates, including security fixes and new features.
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
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 sepaDebitClient: BTSEPADirectDebitClient!
override func viewDidLoad() {
super.viewDidLoad()
self.sepaDirectDebitClient = BTSEPADirectDebitClient(authorization: "<#CLIENT_AUTHORIZATION#>")
}
func sepaDirectDebitButtonTapped() {
let billingAddress = BTPostalAddress(
recipientName = "John Doe",
streetAddress: "123 Main St",
extendedAddress: "#101",
locality = "Amsterdam",
countryCodeAlpha2 = "NL",
postalCode = "1072 AE"
)
let sepaDirectDebitRequest = BTSEPADirectDebitRequest(
accountHolderName = "John Doe",
iban = "FR7618106000321234566666608",
customerID = "1234",
billingAddress = billingAddress,
mandateType = .oneOff
)
sepaDirectDebitClient.tokenize(sepaDirectDebitRequest) {
sepaDirectDebitNonce, error in
if let sepaDirectDebitNonce {
// send sepaDirectDebitNonce.nonce to server
} else if let error {
if error as? BTSEPADirectDebitError == .webFlowCanceled {
// handle cancel
} else {
// handle error
}
}
}
}