-
Initialize a new BTThreeDSecureClient instance.
Declaration
Swift
@objc(initWithAPIClient:) public init(apiClient: BTAPIClient)
Parameters
apiClient
An API client
-
Starts the 3DS flow using a BTThreeDSecureRequest.
Declaration
Swift
public func startPaymentFlow(_ request: BTThreeDSecureRequest, completion: @escaping (BTThreeDSecureResult?, Error?) -> Void)
Parameters
request
A BTThreeDSecureRequest request.
completion
This completion will be invoked exactly once when the 3DS flow is complete or an error occurs.
-
Creates a stringified JSON object containing the information necessary to perform a lookup.
Declaration
Swift
@objc(prepareLookup:completion:) public func prepareLookup( _ request: BTThreeDSecureRequest, completion: @escaping (String?, Error?) -> Void )
Parameters
request
The
BTThreeDSecureRequest
object where prepareLookup was called.completion
This completion will be invoked exactly once with the client payload string or an error.
-
prepareLookup(_:
Asynchronous) Creates a stringified JSON object containing the information necessary to perform a lookup.
Throws
AnError
describing the failureDeclaration
Swift
public func prepareLookup(_ request: BTThreeDSecureRequest) async throws -> String
Parameters
request
The
BTThreeDSecureRequest
object where prepareLookup was called.Return Value
On success, you will receive a client payload string
-
Initialize a challenge from a server side lookup call.
Note
Majority of 3DS integrations do not need to use this method. Only for server-side 3DS integrations.Declaration
Swift
@objc(initializeChallengeWithLookupResponse:request:completion:) public func initializeChallenge( lookupResponse: String, request: BTThreeDSecureRequest, completion: @escaping (BTThreeDSecureResult?, Error?) -> Void )
Parameters
lookupResponse
The JSON string returned by the server side lookup.
request
The BTThreeDSecureRequest object where prepareLookup was called.
completion
This completion will be invoked exactly once when the payment flow is complete or an error occurs.
-
initializeChallenge(lookupResponse:
Asynchronousrequest: ) Initialize a challenge from a server side lookup call.
Throws
AnError
describing the failureDeclaration
Swift
public func initializeChallenge( lookupResponse: String, request: BTThreeDSecureRequest ) async throws -> BTThreeDSecureResult
Parameters
lookupResponse
The JSON string returned by the server side lookup.
request
The BTThreeDSecureRequest object where prepareLookup was called.
Return Value
On success, you will receive an instance of
BTThreeDSecureResult