Getnet DocsGetnet Docs

Create a Single-Step Payment

This guide shows you how to create an automated payment flow that minimizes user interaction by pre-configuring payment parameters and bypassing manual selection screens. With a single-step payment, the terminal processes the transaction quickly with minimal taps from the user.

Before you begin

Before starting, ensure you have:

  • Read how to perform a Polling call (getnet://payment/v1/polling) before initiating the transaction to ensure there are no pending transactions or locked processes.
  • Getnet Payment App installed on the Android terminal.
  • A unique callerId to correlate the request with the response.

Single-step payments work best when combined with calculated operation mode (operationMode = "1"), where your application handles all interest calculations before sending the request.

Step 1: Configure and send the payment Intent

To create a single-step flow, configure the Intent with all required parameters and automation flags. The following table describes all parameters you can use:

ParameterTypeRequiredDescription
amountStringYesTransaction amount (with two implicit decimal places, e.g., “10000” = $100.00)
originalAmountStringYesValue in local currency to perform the transaction.
tipStringNoTip amount to be added to the transaction total. Decimal representation is the same as amount parameter (e.g., “500” = $5.00)
waiterCodeStringConditionalWaiter code for tip attribution. Required if a tip is provided.
receiptCodeStringYesIdentification code to be printed on receipt
callerIdStringYesUnique identifier to correlate request with response
paymentMethodStringNo"1" for Card, "2" for QR Code. Skips payment method selection screen.
installmentsStringNoNumber of desired installments (credit card only)
planIdStringNoInstallment plan ID. Check available plans for your market.
interestStringNoWhether the installment plan includes interest ("true") or is interest-free ("false")
operationModeStringNo"1" for calculated mode (your app handles interest), "0" for manual (terminal processes business rules). See Interest Calculation Strategy guide.
skipConfirmationStringNoSet to "true" to bypass the installment and interest review screen. "false" (default) displays the screen normally - users must interact to proceed.
skipReceiptStringNoSet to "true" to suppress the customer receipt view screen after approval. "false" (default) displays the screen normally.
allowPrintCurrentTransactionStringNoSet to "true" to let Getnet handle receipt printing (default behavior). See Printing Responsibility guide.

Here’s a basic example with the required parameters:

private val REQUEST_CODE = 1001

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("getnet://payment/v1/payment"))
intent.putExtra("amount", "10000")              // $100.00
intent.putExtra("originalAmount", "10000")
intent.putExtra("receiptCode", "987654")
intent.putExtra("callerId", "req_001")

startActivityForResult(intent, REQUEST_CODE)

Step 2: Handle the response

The terminal returns the response via onActivityResult. Check the result field to confirm success:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    
    if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
        val result = data?.extras?.getString("result")
        
        when (result) {
            "0" -> {
                // Transaction approved
                val nsu = data?.extras?.getString("nsu")
                val authCode = data?.extras?.getString("authorizationCode")
                val amount = data?.extras?.getString("amount")
                // Handle success
            }
            else -> {
                // Transaction failed or cancelled
                val resultDetails = data?.extras?.getString("resultDetails")
                // Handle error
            }
        }
    }
}

Response Parameters

The terminal response includes the following key fields:

ParameterTypeDescription
resultStringTransaction result: "0" for success, other values indicate failure or cancellation. See Result Codes reference.
resultDetailsStringDetailed message about transaction results (e.g., “APPROVED”, error descriptions)
amountStringFinal charged amount with two implicit decimal places
tipStringTip amount added to the transaction (if provided)
waiterCodeStringWaiter code for tip attribution (if provided)
receiptCodeStringIdentification code printed on receipt
callerIdStringThe unique identifier sent in the request to correlate with response
nsuStringGetnet transaction authorization code - unique per terminal (cannot be repeated in a day)
authorizationCodeStringAuthorization code provided by the card issuer
paymentTypeStringPayment type used: credit, debit, voucher, etc.
brandStringCard brand (e.g., “VISA”, “MASTERCARD”)
cardBinStringFirst 8 digits of the card (BIN)
cardLastDigitsStringLast 4 digits of the card used
inputTypeStringCard input method: "021" (magnetic stripe), "051" (chip), "071" (contactless chip), "801" (magnetic stripe - fallback)
gmtDateTimeStringGMT date and time of transaction (format: MMDDhhmmss, GMT UTC 0)
installmentsStringNumber of installments processed (if applicable)
planIdStringInstallment plan ID used during transaction (if applicable)
interestStringWhether interest was applied: "true" (with interest) or "false" (without interest)
automationSlipStringReceipt data in JSON format (returned when allowPrintCurrentTransaction = "false"). See Printing Responsibility guide.

Next steps

After successfully creating a payment, you may want to explore: