Transaction
public class Transaction: NSObject, DTErrorHandlerDelegate
Use this class to start a transaction with a mobileToken that has previously been initialized
with a server-to-server init call.
This class is the main class to start any operation with the SDK.
After the transaction has been completed - regardless if successful or not - delegate will
be called with some basic information about the success or failure.
-
This delegate will be notified after a transaction has been finished, successfully or not.
Declaration
Swift
public weak var delegate: TransactionDelegate? -
The available options for how a transaction is handled by the mobile SDK.
Declaration
Swift
public var options = TransactionOptions() -
The theme to be used by the SDK.
Declaration
Swift
public var theme = ThemeConfiguration() -
Use this init method to start the SDK with a mobile token obtained after a server-to-server init call.
After this class is initialized, you should define its delegate, the
optionsproperties and athemeif desired.Declaration
Swift
public init(mobileToken: String)Parameters
mobileTokenThe mobileToken that has previously been initialized with a server-to-server init call.
-
Use this init method to start the SDK with a mobile token and the provided
cardfor the transaction.For this to work, you can only send one payment method in your server-to-server init call. Use this init method if you use your own UI fields for the card information.
Declaration
Swift
public init(mobileToken: String, card: Card)Parameters
mobileTokenThe mobileToken that has previously been initialized with a server-to-server init call.
cardCard object used for the transaction.
-
Use this init method to start the SDK with a mobile token and a single saved payment method.
The payment will be started with this saved payment method.
Declaration
Swift
public init(mobileToken: String, savedPaymentMethod: SavedPaymentMethod)Parameters
mobileTokenThe mobileToken that has previously been initialized with a server-to-server init call.
savedPaymentMethodThe saved payment method to use for this payment.
-
Use this init method to start the SDK with a mobile token and a selection of one or more saved payment methods to display.
The user will then be able to tap on their desired saved payment method to finalize the payment.
Declaration
Swift
public init(mobileToken: String, savedPaymentMethods: [SavedPaymentMethod])Parameters
mobileTokenThe mobileToken that has previously been initialized with a server-to-server init call.
savedPaymentMethodsSpecify here the saved payment methods that are available for selection to the user.
-
Starts the SDK and displays any needed user interface using the provided
presentingController. Note that a transaction can only be started once. For SwiftUI, useView.datatrans(startWithTransaction:)instead.Declaration
Swift
public func start(presentingController: UIViewController)Parameters
presentingControllerUIViewControllerused to present the user interface during an on-going transaction
View on GitHub