Add 3DS to Universal Checkout

3D Secure is a card industry authentication protocol for online payments, providing an extra layer of security for merchants selling online. Customers are sent through the card issuing bank's verification service when making a payment, before proceeding with the authorization request.


Ensure you follow the steps below to enable your Universal Checkout integration to leverage 3DS:

Contact your Primer representative to enable 3DS on your Primer account and grant access to the Primer 3DS libraries. Once your account is set up you should have access to the Primer 3DS library.
Setup a 3DS workflow on your Dashboard.


With CocoaPods

  • Modify your Podfile like so:
source ''source '' use_frameworks! target 'PrimerSDK_Example' do  pod 'PrimerSDK'  pod 'Primer3DS'    // ...end

Then run pod install to install Primer3DS on your workspace!

With Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into Xcode. In order to add PrimerSDK with Swift Package Manager;

  1. 1
    Select your project, and then navigate to Package Dependencies
  2. 2
    Click on the + button at the bottom-left of the Packages section
  3. 3
  4. 4
    Press Add Package
  5. 5
    Let Xcode download the package and set everything up

Adding Primer 3DS


If Primer3DS is not installed, 3DS will fail. In the case of a 3DS triggered by the workflow, the primerDidFailWithError functions will be called.

If you notice a console warning "Failed to import Primer3DS" on the SDK initialization, go to Scheme settings and select Manual order.


Up Next