Getnet DocsGetnet Docs

Create a Single-Step Payment

This guide explains how to process a standard PAGO (sale) transaction using Get Central. A single-step payment performs authorization and capture in one operation and represents the most common flow for attended Point-of-Sale (POS) environments.

This guide applies to TpvpcImplantado.

TpvpcImplantado exposes the same native library through C# (DLL), Java (JAR) and JavaScript (Local Service). Differences between platforms affect only how the function is invoked, not the parameters, business logic, or response validation.

Requirements

Before you begin, ensure the following prerequisites are met:

  • Get Central (TPVPC) installed and available

    • Native library (DLL / JAR), or
    • Local Service (for JavaScript integrations)
  • Merchant credentials provided by the acquirer:

    • cComercio (merchant number)
    • cTerminal (terminal number)
    • cClaveFirma (signature key)
  • Physical PIN pad connected to the same machine as the TPVPC

  • Successful initialization via fnDllIniTpvpcLatente

The PIN pad and the TPVPC must run on the same machine. Distributed or remote scenarios are not supported.

Single-Step Payment Process

A single-step payment consists of the following logical steps:

  1. Initialize communication with Get Central (once per application lifecycle)
  2. Execute a PAGO operation using the PIN pad
  3. Parse the XML response to determine whether the transaction was authorized

Only the XML response determines the financial outcome of the transaction.

Step 1: Execute a PAGO Operation

To perform a sale with card reading, invoke the function:

  • fnDllOperPinPad

This function handles card reading, customer interaction, and host communication.

The following parameters are required:

ParameterTypeRequiredDescription
cImporteStringYesTransaction amount in format XXXXXXXXX.XX (for example, 25.90).
cFacturaStringYesMerchant reference used to identify the transaction.
cTipoOperStringYesOperation type. Must be set to PAGO.
cXMLRespBufferYesOutput buffer that will receive the XML response.
iTamMaxRespIntegerYesMaximum size of the response buffer. Minimum recommended value: 8192.

Example in C#:

StringBuilder xmlResponse = new StringBuilder(8192);

int result = fnDllOperPinPad(
    "25.90",       // cImporte
    "ORD-2023-001",// cFactura
    "PAGO",        // cTipoOper
    xmlResponse,
    xmlResponse.Capacity
);

When the function is called:

  • The PIN pad prompts the cardholder
  • The transaction is processed
  • The XML response is written into cXMLResp

A return value of 0 only confirms that the process completed correctly.

Step 2: Validate the XML Response

After execution, the TPVPC returns an XML document describing the transaction result. This XML is the only authoritative source to determine whether the payment was approved.

A transaction must be considered AUTHORIZED only if the XML response contains both of the following elements:

<estado>F</estado>
<resultado>Autorizada</resultado>

If either element is missing or contains a different value, the transaction must be treated as DENIED, even if the function returned 0.

This is an example of an authorized response:

<resultadoOperacion>
  <tipoPago>PAGO</tipoPago>
  <importe>25.90</importe>
  <moneda>978</moneda>
  <pedido>ORD-2023-001</pedido>
  <estado>F</estado>
  <resultado>Autorizada</resultado>
  <codigoRespuesta>0000</codigoRespuesta>
</resultadoOperacion>

Next Steps

After completing a successful PAGO operation, you can proceed with further implementation: