Transaction
@objc(DTTransaction)
public final class Transaction : NSObject
Use this class to start a transaction with a transactionId 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
@objc public weak var delegate: TransactionDelegate? -
The available options for how a transaction is handled by the mobile SDK.
Declaration
Swift
@objc public var options: TransactionOptions -
The theme to be used by the SDK.
Declaration
Swift
@objc public var theme: ThemeConfiguration -
Use this init method to start the SDK with a transaction ID obtained from a server-to-server init call.
After this class is initialized, you should set its
delegate,options, and optionally atheme.Declaration
Swift
@objc public init(transactionId: String)Parameters
transactionIdThe transaction ID from a server-to-server init call.
-
Use this init method to start the SDK with a transaction ID 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
@objc public init(transactionId: String, card: Card)Parameters
transactionIdThe transaction ID from a server-to-server init call.
cardCard object used for the transaction.
-
Use this init method to start the SDK with a transaction ID and a single saved payment method.
The payment will be started with this saved payment method.
Declaration
Swift
@objc public init(transactionId: String, savedPaymentMethod: SavedPaymentMethod)Parameters
transactionIdThe transaction ID from 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 transaction ID 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
@objc public init(transactionId: String, savedPaymentMethods: [SavedPaymentMethod])Parameters
transactionIdThe transaction ID from a server-to-server init call.
savedPaymentMethodsSpecify here the saved payment methods that are available for the user to select.
-
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
@objc public func start(presentingController: UIViewController)Parameters
presentingControllerUIViewControllerused to present the user interface during an on-going transaction
View on GitHub