The Checkout.com 3D Secure (3DS) mobile SDK allows you to provide a native 3DS2 experience in your mobile app, with visual styling that you can control.
The SDK handles the device data collection, communication with the card issuer, and presentation of 3D Secure challenges to the customer when required.
👉 See the Integration Guide with Code Examples
📚 Read the reference documentation
We’ve done our best to support the most common distribution methods on iOS. We are in strong favour of SPM (Swift Package Manager)
⚠️ Important
SPM (Swift Package Manager) and CocoaPods can usually coexist in the same project without issues. That said, since CocoaPods is now in maintenance mode, the iOS team made a tech decision to officially support only SPM going forward. It’s simpler to manage and already works well alongside CocoaPods if needed.
Swift Package Manager integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. It should work out of the box on latest Xcode projects since Xcode 11 and has had a lot of community support, seeing huge adoption over the recent years. This is our preferred distribution method for Frames iOS and is the easiest one to integrate, keep updated and build around.
If you’ve never used it before, get started with Apple’s step by step guide into adding package dependencies to your app .
.package(url: "https://github.com/checkout/checkout-3ds-sdk-ios", from: "X.Y.Z")
⚙️ Adding Environment Variable for SPM Integration
You may need to add the following environment variable to your Run Scheme if Checkout3DS-Security.framework fails to load:
<EnvironmentVariable
key="DYLD_INSERT_LIBRARIES"
value="$(TARGET_BUILD_DIR)/Checkout3DS.framework/Checkout3DS:$(TARGET_BUILD_DIR)/Checkout3DS-Security.framework/Checkout3DS-Security"
isEnabled="YES">
</EnvironmentVariable>
This environment variable ensures the dynamic libraries are correctly loaded at runtime.
How to add this environment variable:
$(TARGET_BUILD_DIR)/Checkout3DS.framework/Checkout3DS:$(TARGET_BUILD_DIR)/Checkout3DS-Security.framework/Checkout3DS-SecurityThen, configure your app to:
This integration method involves one call to our authenticate method, which will perform an entire Authentication flow using Checkout.com’s 3DS servers.
uiCustomization object.Result type with two cases
AuthenticationResult with transactionStatus and sdkTransactionID 👉 More info about transaction statusAuthenticationError with a message.👉 Strongly recommend providing the appURL parameter as a universal link. Apple Documentation
// 1. Init with defaults
let checkout3DS = Checkout3DSService()
// 2. Init with explicit arguments
let checkout3DS = Checkout3DSService(
environment: .production,
locale: Locale(identifier: "en_GB"),
uiCustomization: uiCustomization,
appURL: URL(string: "https://www.MerchantRequestorAppUniversalLink.com")
)
let authenticationParameters = AuthenticationParameters(
sessionID: sessionID,
sessionSecret: sessionSecret,
scheme: scheme)
checkout3DS.authenticate(authenticationParameters: authenticationParameters) { result in
switch authenticationResult {
case .success(let authenticationResult):
// handle authentication result. Checkout Payment Authorisation section.
case .failure(let error):
// handle failure scenarios
}
}
👉 See the Integration Guide with Code Examples for full details.
📚 Read the reference documentation
After initiating the authentication process and obtaining the AuthenticationResult object, you can continue the authentication flow based on the value of transStatus:
transStatus |
Description | Proceed with Payment Authorisation Request |
|---|---|---|
Y |
Authentication verification successful. | Yes |
A |
Attempt at processing performed. | Yes |
I |
Informational only. | Yes |
N |
Not authenticated or account not verified. | No |
R |
Authentication or account verification rejected. | No |
U |
Authentication or account verification could not be performed. | No |
👉 More info about transaction status
Our iOS SDK depends on some external libraries:
For help using the 3D Secure SDK, or to pass on your feedback, you can email our team at support@checkout.com.
If you’ve found a bug, we encourage you to open an issue through GitHub. If your problem isn’t already listed, please detail the versions of the SDK and your development environment that you’re using, what you were hoping to accomplish, and what the actual result you observed was.
If you have an idea for a new feature, we’d also love to hear about it through GitHub. Please open an issue, detailing your idea and why it’s important for your project.
This software is released under license. See LICENSE for details.