Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrate from 2.x to 3.0

Starting with TMG SDK 3.0.0, several public APIs are simplified.

Initialize the SDK

The SDK removes TMGClientConfiguration.Builder and moves configuration to the TMGClientConfiguration initializer:

What changed

  • Deprecated certificatePins. The SDK now manages certificate pinning internally.

  • Renamed serverUrl to serverURL.

  • Renamed serverKeyId to serverKeyID.

let serverUrl;
let serverCertificate;
let keyIdentifier;
let configurationBuilder = TMGClientConfiguration.Builder(serverUrl: serverUrl, 
                                                          serverCertificate: Data(serverCertificate.utf8), 
                                                          serverKeyId: keyIdentifier)
let configuration: TMGClientConfiguration = TMGClientConfiguration(builder: configurationBuilder)
let serverURL = ""
let serverCertificate = ""
let serverKeyID = ""
let configuration = TMGClientConfiguration(serverURL: serverURL,
                                           serverCertificate: Data(serverCertificate.utf8),
                                           serverKeyID: serverKeyID)

Initialize VisaCTFHelper

In TMG SDK 3.0.0, createVisaCTFHelper changes from async to sync. This simplifies error handling and control flow.

Update device binding flows (green and yellow)

Device binding covers device authentication, Identification and Verification (ID&V), and binding completion. In TMG SDK 3.0.0, the flow:

  • Standardized the use of completionHandler.

  • Removed the mix of delegate and completionHandler.

  • Removed the need to handle binding success in multiple places.

  • Streamlined control flow.

When migrating from earlier SDK versions, note these API renames:

  • PendingBindingSession is now VisaCTFHelper.IDVSession.

  • DeviceAuthenticationDelegate is now DeviceAuthentication.

  • IdvMethod is now IDVMethod.

  • IdvType is now IDVType.

  • OtpActivationStatus is now OTPActivationStatus.

    • maxOtpRequestsAllowed is now maxOTPRequestsAllowed.

    • maxOtpVerificationAllowed is now maxOTPVerificationAllowed.

Use the code below to update your device binding integration:

Resume a binding (resumeBinding)

The resumeBinding flow is unchanged from earlier versions. Only the IDVSession (ID&V) steps change.

Get the binding state (bindingState)

In TMG SDK 3.0.0, bindingState changes from async to sync. This simplifies error handling and control flow.

Authenticate a transaction

Transaction authentication covers device authentication and returning the Visa payload. In TMG SDK 3.0.0, the flow:

  • Standardized the use of completionHandler.

  • Removed the mix of delegate and completionHandler.

Use the code below to update your transaction authentication integration:

Remove a binding (removeBinding)

removeBinding now requires an additional correlationID.

Sync binding state (syncBindingState)

syncBindingState now requires an additional correlationID.

Read the previously selected ID&V method

In addition to the IDVSession functions used in the createBinding flow, you can read the previously selected ID&V method. In TMG SDK 3.0.0, previouslySelectedIDVMethod changes from async to sync. This simplifies error handling and control flow.

Last updated

Was this helpful?