Required to create an instance of TyroTapToPaySdk.
See ConnectionProvider for parameter info.
This is used to test the development environment.
class TyroEnvDev(
connectionProvider: ConnectionProvider
) : TyroEnv()connectionProviderConnectionProviderrequired
Your class that implements the Connection Provider interface which makes a call to your server to fetch the connectionSecret.
This is used for production.
class TyroEnvProd(
connectionProvider: ConnectionProvider
) : TyroEnv()connectionProviderConnectionProviderrequired
Your class that implements the Connection Provider interface which makes a call to your server to fetch the connectionSecret.
This is used when you just want to test the app without hitting the real environment. Responses and delays can be set in the constructor.
class TyroEnvStub(
val initStatus: InitStatus = INIT_SUCCESS,
val transactionStatus: TransactionStatus = TXN_SUCCESS,
val initDelayMillis: Long = 3000,
val transactionDelayMillis: Long = 5000
) : TyroEnv()initStatusInitStatus
The stubbed status that will returned after initialisation
Enum"INIT_SUCCESS""INIT_CONNECTION_ERROR""INIT_AUTH_ERROR""INIT_NFC_UNAVAILABLE_ERROR""INIT_REQUEST_PERMISSIONS_ERROR""INIT_ATTESTATION_FAILED_ERROR""INIT_ATTESTATION_ERROR""INIT_SDK_ERROR""INIT_ERROR"
transactionStatusTransactionStatus
The stubbed status that will be returned after transactions are executed.
Enum"TXN_SUCCESS""TXN_DECLINED""TXN_FAILED""TXN_NO_APP_ERROR""TXN_FAILED_ALLOW_FALLBACK""TXN_CARD_EXPIRED""TXN_ONLINE_ERROR""TXN_CANCELLED""TXN_TIMEOUT""TXN_CARD_ERROR"
initDelayMillisLong
The amount of delay before initialisation completes.
transactionDelayMillisLong
The amount of delay before a transaction completes.