TokenizationRequestDelegate

@objc(DTTokenizationRequestDelegate)
public protocol TokenizationRequestDelegate

Implement TokenizationRequestDelegate to be notified when a tokenization request ends. TokenizationRequestDelegate will notify you about the success, error or cancel state of the processed tokenization request.

  • This is called after a tokenization request has been successfully completed. This callback provides details about the tokenization request.

    Declaration

    Swift

    func tokenizationRequestDidFinish(_ tokenizationRequest: TokenizationRequest, tokenizationId: String)

    Parameters

    tokenizationRequest

    The object containing the information of the completed tokenization request.

    tokenizationId

    The resulting tokenizationId.

  • This is called after a tokenization request fails or encounters an error. Keep in mind that the SDK shows the error to the user before this is invoked. Therefore, this callback can be used to cancel any on-going process involving the tokenization request.

    You may also use the error details provided here and display it the way you want when suppressing the error message within the TokenizationRequestOptions.

    Declaration

    Swift

    func tokenizationRequestDidFail(_ tokenizationRequest: TokenizationRequest, error: TokenizationRequestError)

    Parameters

    tokenizationRequest

    The object containing the information of the failed tokenization request.

    error

    The error that occurred.

  • This is called after a tokenization request has been cancelled. This callback can be used to cancel any on-going process involving the tokenization request.

    Declaration

    Swift

    @objc
    optional func tokenizationRequestDidCancel(_ tokenizationRequest: TokenizationRequest)

    Parameters

    tokenizationRequest

    The object containing the information of the cancelled tokenization request.