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.

Prerequisites

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.

Integration

With CocoaPods

  • Add Primer’s private specs repo at the top of your podfile
  • Add the Primer3DS pod

Your podfile should look like this:

12345678910
source 'https://github.com/CocoaPods/Specs.git'source 'https://github.com/primer-io/primer-podspecs.git' use_frameworks! target 'PrimerSDK_Example' do  pod 'PrimerSDK'  pod 'Primer3DS'    // ...end
swift
copy

With Swift Package Manager

With your Xcode project opened:

  • Select the project like, then Package Dependencies like the example below Package Dependencies
  • Click on the + button at the bottom of the Packages section
  • In the Search Bar at your left, paste the Primer 3DS URL: https://github.com/primer-io/primer-sdk-3ds-ios Search for Primer 3DS Adding Primer 3DS
  • Press Add Package
  • Let Xcode download the package and set everything up

Ensure that the 3DS Framework is Imported Correctly

  1. 1
    Clean, build and run your project
  2. 2
    Once PrimerSDK is initialized check the console logs whether Can import Primer3DS is logged.
  3. 3
    If you want to perform 3DS when vaulting cards you should set is3DSOnVaultingEnabled in the PrimerSettings object to true.
  4. 4
    That’s it! 🎉 Check the 3DS testing section below to understand how to perform 3DS payments in your sandbox environment.

Troubleshooting

If you see Failed to import Primer3DS in the console logs, choose Manual Order in your project's scheme. See the screenshots below for details. Manage Schemes Manual Order