public class OppThreeDSService
extends java.lang.Object
The service should be initialized just once per app session.
Call initialize(Context, TransactionMode, List)
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 createTransaction(String, String)
method.
Modifier and Type | Class and Description |
---|---|
static class |
OppThreeDSService.Callback
A callback to be notified when
OppThreeDSService initialization is done. |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp()
The cleanup method frees up resources that are used by the 3DS SDK.
|
OppThreeDSTransaction |
createTransaction(java.lang.String paymentBrand)
Deprecated.
Use
createTransaction(String, String) instead.
Creates transaction object for the specific payment brand.
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 |
createTransaction(java.lang.String paymentBrand,
java.lang.String protocolVersion)
Creates transaction object for the specific payment brand and protocol version.
|
OppThreeDSConfig |
getConfig()
Configuration object to be used during service initialization.
|
static OppThreeDSService |
getInstance()
Returns single instance of the
OppThreeDSService class. |
java.lang.String |
getNsoftwareVersion() |
java.util.List<java.lang.String> |
getPaymentBrands()
Returns list of payment brands specified during initialization.
|
static java.lang.String |
getSDKVersion()
Returns version of the 3DS SDK.
|
java.util.List<Warning> |
getWarnings()
Returns warnings produced by the security checks during the service initialization.
|
void |
initialize(android.content.Context context,
TransactionMode transactionMode,
java.util.List<java.lang.String> paymentBrands)
Initializes the service, starts preparation for the 3-D Secure authentication.
|
boolean |
isInitialized()
Returns true if service is initialized, false otherwise.
|
void |
setConfig(OppThreeDSConfig config)
Sets configuration information that shall be used during initialization.
|
void |
setCustomSchemeConfig(java.util.Map<java.lang.String,SchemeConfig> schemeConfigMap)
Provides possibility to overwrite config information for the specific schemes to run
transactions within specific environment.
|
void |
setInitCallback(OppThreeDSService.Callback initCallback)
Sets the callback which will be called after service initialization is done.
|
public static OppThreeDSService getInstance()
OppThreeDSService
class.OppThreeDSService
classpublic void initialize(android.content.Context context, TransactionMode transactionMode, java.util.List<java.lang.String> paymentBrands) throws InvalidInputException, SDKRuntimeException
Preparation includes loading DS certificates for the specified payment brands, performing security checks and collecting device data as a background task.
You can know that initialization is done by checking isInitialized()
or
setInitCallback(Callback)
to be notified about the result of initialization.
The state of the service is maintained until the cleanUp()
method is called.
context
- the instance of application contexttransactionMode
- the mode to switch between test and live systempaymentBrands
- the list of payment brands which support 3-D Secure 2InvalidInputException
- if list of payment brands is empty or transaction mode is invalidSDKRuntimeException
- if some internal error occurredpublic boolean isInitialized()
public java.util.List<java.lang.String> getPaymentBrands()
public OppThreeDSConfig getConfig()
If no custom config is set, the method will return default configuration to be used.
public void setConfig(OppThreeDSConfig config)
It's an optional method, if no config is set before initialization then default one will be applied.
config
- the object containing configuration information to be applied during the initializationOppThreeDSConfig
public void setInitCallback(OppThreeDSService.Callback initCallback)
initCallback
- the callback to be notified when service initialization is done@Deprecated public OppThreeDSTransaction createTransaction(java.lang.String paymentBrand) throws InvalidInputException, SDKNotInitializedException, SDKRuntimeException
createTransaction(String, String)
instead.
Creates transaction object for the specific payment brand.
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()
.
paymentBrand
- brand of the shopper's cardInvalidInputException
- if payment brand is not valid, e.g. it was not specified at
OppThreeDSService
initialization phaseSDKNotInitializedException
- if service has not yet been initializedSDKRuntimeException
- if some internal error occurredpublic OppThreeDSTransaction createTransaction(java.lang.String paymentBrand, java.lang.String protocolVersion) throws InvalidInputException, SDKNotInitializedException, SDKRuntimeException
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()
.
paymentBrand
- brand of the shopper's cardprotocolVersion
- the protocol version to useInvalidInputException
- if payment brand is not valid, e.g. it was not specified at
OppThreeDSService
initialization phaseSDKNotInitializedException
- if service has not yet been initializedSDKRuntimeException
- if some internal error occurredpublic void cleanUp() throws SDKNotInitializedException
SDKNotInitializedException
- if service has not yet been initializedpublic java.util.List<Warning> getWarnings() throws SDKNotInitializedException
These can be checked by the app to determine whether or not to proceed with the checkout process.
SDKNotInitializedException
- if service has not yet been initializedpublic void setCustomSchemeConfig(java.util.Map<java.lang.String,SchemeConfig> schemeConfigMap)
schemeConfigMap
- Map of the scheme config info, where key is a scheme, e.g. VISA.public static java.lang.String getSDKVersion()
public java.lang.String getNsoftwareVersion()