public class Config
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENVIRONMENT_PRODUCTION
The constant string representing the production environment.
|
static java.lang.String |
ENVIRONMENT_STAGE
The constant string representing the staging environment.
|
Constructor and Description |
---|
Config(android.content.Context context,
java.lang.String clientId,
java.lang.String environment)
Instantiates a new config.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClientId()
Gets the client id.
|
android.content.Context |
getContext()
Gets the context.
|
java.lang.String |
getEnvironment()
Gets the environment.
|
LogLevel |
getLogLevel()
Gets the log level.
|
MockConfig |
getMockConfig()
Gets the MockConfig instance.
|
boolean |
isUseLocation()
Determines if we should use location services.
|
boolean |
isUseTestEMVCards()
Determines if we should use test EMV cards.
|
Config |
setLogLevel(LogLevel logLevel)
Sets the log level.
|
Config |
setMockConfig(MockConfig mockConfig)
Sets the MockConfig instance to be used.
|
Config |
setRestartTransactionAfterGeneralError(boolean restartTransactionAfterGeneralError)
Sets the option for the transaction to automatically restart after a general error (errorCategory:ERROR_CATEGORY_CARD_READER, errorCode:CARD_READER_GENERAL_ERROR).
|
Config |
setRestartTransactionAfterOtherErrors(boolean restartTransactionAfterOtherErrors)
Sets the option for the transaction to automatically restart after an error other than general error.
|
Config |
setRestartTransactionAfterSuccess(boolean restartTransactionAfterSuccess)
Sets the option for the transaction to automatically restart after a successful swipe.
|
Config |
setStopCardReaderAfterOperation(boolean stopCardReaderAfterOperation)
Sets the option for the card reader to automatically stop after an operation.
|
Config |
setUseLocation(boolean useLocation)
Sets the option for using location services for fraud detection purposes.
|
Config |
setUseTestEMVCards(boolean useTestEMVCards)
Sets the option for using test EMV cards.
|
boolean |
shouldRestartTransactionAfterGeneralError()
Determines if the transaction should automatically restart after a general error (errorCategory:ERROR_CATEGORY_CARD_READER, errorCode:CARD_READER_GENERAL_ERROR).
|
boolean |
shouldRestartTransactionAfterOtherErrors()
Determines if the transaction should automatically restart after an error other than general error.
|
boolean |
shouldRestartTransactionAfterSuccess()
Determines if the transaction should automatically restart after a successful swipe.
|
boolean |
shouldStopCardReaderAfterOperation()
Determines if the card reader should automatically stop after a transaction is completed.
|
java.lang.String |
toString() |
public static final java.lang.String ENVIRONMENT_STAGE
public static final java.lang.String ENVIRONMENT_PRODUCTION
public Config(android.content.Context context, java.lang.String clientId, java.lang.String environment)
context
- the application contextclientId
- the client id for your WePay appenvironment
- the environment (use one of the provided constants - ENVIRONMENT_STAGING or ENVIRONMENT_PRODUCTION)public android.content.Context getContext()
public java.lang.String getClientId()
public java.lang.String getEnvironment()
public boolean isUseLocation()
public Config setUseLocation(boolean useLocation)
useLocation
- the permission to use locationpublic boolean isUseTestEMVCards()
public Config setUseTestEMVCards(boolean useTestEMVCards)
useTestEMVCards
- the permission to use locationpublic boolean shouldStopCardReaderAfterOperation()
public Config setStopCardReaderAfterOperation(boolean stopCardReaderAfterOperation)
stopCardReaderAfterOperation
- the flag to determine if the card reader should automatically stop after an operation.public boolean shouldRestartTransactionAfterSuccess()
public Config setRestartTransactionAfterSuccess(boolean restartTransactionAfterSuccess)
restartTransactionAfterSuccess
- the flag to determine if the transaction should automatically restart after a successful swipe.public boolean shouldRestartTransactionAfterGeneralError()
public Config setRestartTransactionAfterGeneralError(boolean restartTransactionAfterGeneralError)
restartTransactionAfterGeneralError
- the flag to determine if the transaction should automatically restart after a general error.public boolean shouldRestartTransactionAfterOtherErrors()
public Config setRestartTransactionAfterOtherErrors(boolean restartTransactionAfterOtherErrors)
restartTransactionAfterOtherErrors
- the flag to determine if the transaction should automatically restart after an error other than general error.public LogLevel getLogLevel()
public Config setLogLevel(LogLevel logLevel)
logLevel
- determines which SDK log messages should showpublic MockConfig getMockConfig()
public Config setMockConfig(MockConfig mockConfig)
mockConfig
- the MockConfig instancepublic java.lang.String toString()
toString
in class java.lang.Object