Getnet DocsGetnet Docs

Create a Single-Step Payment

This guide walks you through processing a standard payment transaction using the Get Mini application. A single-step payment charges a specified amount to a card in one operation. This integration relies on a Bluetooth-connected PIN pad to handle card reading and PIN entry.

Requirements

Before you begin, ensure you have:

  • Get Mini application installed on the Android device
  • PIN pad device paired via Bluetooth and connected within the Get Mini app
  • ActivityResultLauncher registered in your Activity to receive results

Ensure the PIN pad is powered on and successfully paired before initiating transactions.

Payment Transaction Process

This section guides you through the process of creating and executing a payment transaction with the Get Mini App2App integration. You’ll learn how to build the Intent and handle the transaction result.

Step 1: Create and Launch the Payment Intent

A payment transaction involves creating an Intent with the Get Mini action, adding the transaction parameters, and launching it using your ActivityResultLauncher. The Get Mini application manages the PIN pad interaction and processes the payment.

The table below lists the parameters you need to include in your Intent:

ParameterTypeRequiredDescription
amountdoubleYesThe total amount to charge
typeintYesSet to 1 for Sale transactions
invoiceStringNoOptional order number or identifier for tracking

The following code example shows how to create and launch a payment Intent:

// Initialize the Intent with the Get Mini action
Intent intent = new Intent("es.redsys.paysys.mPOSRedsys_PAYMENT_REQUEST");

// Add transaction parameters
intent.putExtra("amount", 25.50);
intent.putExtra("type", 1); // 1 = Sale
intent.putExtra("invoice", "ORD-1001"); // Optional identifier

// Launch the Intent
paymentLauncher.launch(intent);

Step 2: Receive and Handle the Transaction Result

After the cardholder completes the transaction on the PIN pad, the Get Mini application returns control to your application through the ActivityResult callback. You should verify that the result code is RESULT_OK and extract the transaction details from the returned Intent extras.

A RESULT_OK status indicates the app returned correctly. You must then inspect the RESULT extra for the value AUTORIZADA to confirm the funds were captured.

The following code example shows how to handle the transaction result:

private final ActivityResultLauncher<Intent> paymentLauncher = registerForActivityResult(
    new ActivityResultContracts.StartActivityForResult(),
    result -> {
        if (result.getResultCode() == Activity.RESULT_OK) {
            Intent data = result.getData();
            if (data != null) {
                String transactionResult = data.getStringExtra("RESULT");

                if ("AUTORIZADA".equals(transactionResult)) {
                    // Transaction successful - extract response data
                    String authCode = data.getStringExtra("AUTHORIZATION");
                    String orderId = data.getStringExtra("ORDER");
                    // Process successful payment
                } else {
                    // Transaction denied
                    // Handle error appropriately
                }
            }
        } else {
            // Transaction cancelled or failed
            // Handle cancellation
        }
    }
);

For complete details on all response fields and error handling, see Handle Transaction Results.

Next Steps

Now that you have successfully processed a single-step payment transaction, you can explore more features of the Get Mini App2App integration: