TokenizationRequest

@objc(DTTokenizationRequest)
public class TokenizationRequest : NSObject

Use this class to start a tokenization request. After the tokenization request 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 tokenization request has been finished, successfully or not.

    Declaration

    Swift

    @objc
    public weak var delegate: TokenizationRequestDelegate?
  • The available options for how a tokenization request is handled by the mobile SDK.

    Declaration

    Swift

    @objc
    public var options: TokenizationRequestOptions
  • The theme to be used by the SDK.

    Declaration

    Swift

    @objc
    public var theme: ThemeConfiguration
  • Use this init method if you use your own UI and already have a Card instance with the card data to be tokenized. After this class is initialized, you should define its delegate, the options properties and a theme if desired.

    Declaration

    Swift

    @objc
    public init(merchantId: String, card: Card)

    Parameters

    merchantId

    Your merchantId.

    card

    Card object to tokenize.

  • Use this init method to allow the user to enter the card data to be tokenized. After this class is initialized, you should define its delegate, the options properties and a theme if desired.

    Declaration

    Swift

    public init(merchantId: String, paymentMethodTypes: [PaymentMethodType])

    Parameters

    merchantId

    Your merchantId.

    paymentMethodTypes

    The allowed credit or debit card types.

  • Use this init method to allow the user to enter the card data to be tokenized. After this class is initialized, you should define its delegate, the options properties and a theme if desired.

    This initializer is for use from Objective-C only. Instead of [PaymentMethodType], it takes [NSNumber] containing rawValues of PaymentMethodType.

    Example: [[DTTokenizationRequest alloc] initWithMerchantId:@"..." paymentMethodTypes:@[@(DTPaymentMethodTypeVisa), @(DTPaymentMethodTypeMasterCard)]];

    Declaration

    Swift

    @objc(initWithMerchantId:paymentMethodTypes:)
    public convenience init(merchantId: String, paymentMethodTypesObjc: [NSNumber])

    Parameters

    merchantId

    Your merchantId.

    paymentMethodTypesObjc

    The allowed credit or debit card types.

  • Starts the SDK and displays any needed user interface using the provided presentingController. Note that a tokenization request 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 tokenization request.