TyroEnv Classes

Required to create an instance of TyroTapToPaySdk.

See ConnectionProvider for parameter info.

TyroEnvDev

This is used to test the development environment.

Copy
Copied
class TyroEnvDev(
    connectionProvider: ConnectionProvider
) : TyroEnv()

Parameters

connectionProvider
required
ConnectionProvider

Your class that implements the Connection Provider interface which makes a call to your server to fetch the connectionSecret.

TyroEnvProd

This is used for production.

Copy
Copied
class TyroEnvProd(
    connectionProvider: ConnectionProvider
) : TyroEnv()

Parameters

connectionProvider
required
ConnectionProvider

Your class that implements the Connection Provider interface which makes a call to your server to fetch the connectionSecret.

TyroEnvStub

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.

Copy
Copied
class TyroEnvStub(
    val initStatus: InitStatus = INIT_SUCCESS,
    val transactionStatus: TransactionStatus = TXN_SUCCESS,
    val initDelayMillis: Long = 3000,
    val transactionDelayMillis: Long = 5000
) : TyroEnv()

Parameters

initStatus
InitStatus

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"
transactionStatus
TransactionStatus

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" "TXN_REQUIRE_CDCVM" "TXN_PERMISSIONS_ERROR" "TXN_VERIFY_CONNECTION_SERVER_ERROR" "TXN_VERIFY_CONNECTION_TYRO_ERROR" "TXN_VERIFY_CONNECTION_REJECTED" "TXN_UNKNOWN_ERROR"
initDelayMillis
Long

The amount of delay before initialisation completes.

transactionDelayMillis
Long

The amount of delay before a transaction completes.

Copyright © Tyro Payments 2019-2024. All right reserved.