Create a TransactionRequest and invoke tapToPaySdk.startTransaction() to start a payment or refund. Transaction results will be received in the onTransactionResult callback passed to tapToPaySdk.registerTransactionResultHandler().
@Throws(InvalidTransactionParamException::class)
fun startTransaction(
activity: ComponentActivity,
transactionRequest: TransactionRequest
)It is strongly recommended to handle any exceptions thrown by tapToPaySdk.startTransaction() otherwise your App will crash. Throws InvalidTransactionParamException when one of the following conditions is not met.
amountInCentsmust be positive and non zeroamountInCentsmust be less than 10,000,000 ($100,000.00)referencemust not be blank
The Android Activity
The request parameters for the transaction.
Request parameters for the transaction. This determines if the transaction is a purchase or refund. PosInfo must be set via sdk.setPosInfo(posInfo) or in this function otherwise an error will be thrown. See PosInfo.
@Parcelize
data class TransactionRequest(
val type: TransactionType,
val amountInCents: Int,
val reference: String,
var posInfo: PosInfo? = null,
) : ParcelableThe type of transaction
The amount in cents.
The identifier for the transaction and MUST be unique.
Optionally provide the PosInfo per transaction. PosInfo must be provided via this parameter or in sdk.setPosInfo() otherwise an error will be thrown.