Transaction

@objc(DTTransaction)
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

    @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 mobile token obtained after a server-to-server init call. After this class is initialized, you should define its delegate, the options properties and a theme if desired.

    Declaration

    Swift

    @objc
    public init(mobileToken: String)

    Parameters

    mobileToken

    The 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 just like in init(mobileToken:) and the provided card for 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(mobileToken: String, card: Card)

    Parameters

    mobileToken

    The mobileToken that has previously been initialized with a server-to-server init call.

    card

    Card object used for the transaction.

  • Use this init method to start the SDK with a mobile token obtained after a server-to-server init call and display the selection of one or more saved tokens. The user will then be able to click on their desired saved token to finalize the payment.

    Declaration

    Swift

    @objc
    public init(mobileToken: String, paymentMethodTokens: [PaymentMethodToken])

    Parameters

    mobileToken

    The mobileToken that has previously been initialized with a server-to-server init call.

    paymentMethodTokens

    Specify here the tokens 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.

    Declaration

    Swift

    @objc
    public func start(presentingController: UIViewController)

    Parameters

    presentingController

    UIViewController used to present the user interface during an on-going transaction