OPPThreeDSService
@objc
public class OPPThreeDSService : NSObject
                Class to perform all necessary preparations for the 3-D Secure 2 authentication.
Note
The service should be initialized just once per app session. CallOPPThreeDSService.initialize(transactionMode:paymentBrands:) method to start the service, it will initiate security checks and collecting device data as background task. It’s recommended to initialize the service once the app is launched or at least once checkout is started.
Once service is initialized OPPThreeDSTransaction object can be obtained for the specific transaction, please see OPPThreeDSService.createTransaction(paymentBrand:protocolVersion:) method.
- 
                  
                  
Single instance of the
OPPThreeDSServiceclass.Declaration
Swift
@objc public static let sharedInstance: OPPThreeDSService - 
                  
                  
The list of payment brands specified during initialization
OPPThreeDSService.Declaration
Swift
@objc public var paymentBrands: [String]? - 
                  
                  
Configuration object to be used during service initialization.
Declaration
Swift
@objc public var config: OPPThreeDSConfig - 
                  
                  
A flag that specifies if service is initialized or not.
Declaration
Swift
@objc public private(set) var isInitialized: Bool { get } - 
                  
                  
The listener which will receive events from the
OPPThreeDSServiceDeclaration
Swift
@objc public var initCallback: OPPThreeDSServiceCallback? 
- 
                  
                  
Initializes the service, starts preparation for the 3-D Secure authentication.
Preparation includes loading DS certificates for the specified payment brands, security checks and collecting device data as background task.
Note
You can know that initialization is done by checkingOPPThreeDSService.isInitializedor setOPPThreeDSService.initCallbackto be notified about the result of initialization.Note
The state of the service is maintained until the
OPPThreeDSService.cleanUp()method is called.Throws
Throws:
InvalidInputExceptionif list of payment brands is empty, or if some invalid data is passed inOPPThreeDSService.configSDKRuntimeExceptionif some internal error occurred.
Declaration
Swift
@objc public func initialize(transactionMode: OPPThreeDSTransactionMode, paymentBrands: [String])Parameters
transactionModethe mode to switch between test and live system.
paymentBrandsthe list of payment brands which support 3-D Secure 2.
 
- 
                  
                  
Creates transaction object for the specific payment brand.
Note
A reference should be kept for this transaction through the entire 3-D Secure process. When the transaction is complete, it should be closed via the
OPPThreeDSTransaction.close()Parameter
- paymentBrand: brand of the shopper’s card.
 - protocolVersion: protocol version according to which the transaction shall be created.
 
Throws
Throws:
InvalidInputExceptionif payment brand is not valid, e.g. it was not specified atOPPThreeDSServiceinitialization phase.SDKNotInitializedExceptionif service has not yet been initialized.SDKRuntimeExceptionif some internal error occurred.
Declaration
Swift
@objc public func createTransaction(paymentBrand: String, protocolVersion: String) throws -> OPPThreeDSTransactionReturn Value
Initialized
OPPThreeDSTransactionobject. - 
                  
                  
The cleanup method frees up resources that are used by the 3DS SDK. It is called only once during a single app session.
Throws
SDKNotInitializedExceptionif service has not yet been initialized.
Declaration
Swift
@objc public func cleanUp() throws - 
                  
                  
Returns warnings produced by the security checks during the service initialization.
Note
These can be checked by the app to determine whether or not to proceed with the checkout process.
Throws
Throws:
SDKNotInitializedExceptionif service has not yet been initialized.
Declaration
Swift
@objc public func getWarnings() throws -> [Warning]Return Value
The list of warnings produced during initialization.
 - 
                  
                  
Provides possibility to overwrite standard certificates and use some custom DS information for the specific brands to process transaction. Should be used for test purposes only.
Declaration
Swift
@objc public func setCustomSchemeConfig(_ schemeConfigDict: [String : OPPThreeDSSchemeConfig])Parameters
schemeConfigDictScheme config information mapped for specific card brands.
 
- 
                  
                  
Creates transaction object for the specific payment brand.
Warning
Deprecated. Use:
createTransaction(paymentBrand:protocolVersion:)Note
A reference should be kept for this transaction through the entire 3-D Secure process. When the transaction is complete, it should be closed via the
OPPThreeDSTransaction.close()Throws
Throws:
InvalidInputExceptionif payment brand is not valid, e.g. it was not specified atOPPThreeDSServiceinitialization phase.SDKNotInitializedExceptionif service has not yet been initialized.SDKRuntimeExceptionif some internal error occurred.
Declaration
Swift
@available(*, deprecated, message: "Use createTransaction(paymentBrand: String, protocolVersion: String﹚ instead") @objc public func createTransaction(paymentBrand: String) throws -> OPPThreeDSTransactionParameters
paymentBrandbrand of the shopper’s card.
Return Value
Initialized
OPPThreeDSTransactionobject. 
      OPPThreeDSService Class Reference