Process a Sale
This guide shows you how to process an immediate payment using App2App integration.
Complete Sale Transaction
// Sale for €25.00
startPaymentTransaction(
type = StartTransactionType.SALE,
amountInCents = 2500,
uniqueTransactionId = "",
enablePrinting = true
)
Parameters
| Parameter | Value | Description |
|---|---|---|
type | StartTransactionType.SALE | Transaction type |
amountInCents | 2500 | Amount in cents (€25.00) |
uniqueTransactionId | "" | Leave empty for sales |
enablePrinting | true | Enable receipt printing |
Amount Format
Always pass amounts in cents/minor currency units (e.g., 1250 = €12.50).
Handle the Response
private fun processPaymentResponse(response: StartTransactionResponse) {
if (response.transApproved == true) {
val authCode = response.authCode
val maskedPan = response.primaryAccountNumber
val amount = response.transAmount // Amount in cents
// Handle success
} else {
val errorCode = response.transactionResponse
// Handle failure
}
}