Refund a Payment

Refund operations (DEVOLUCION) allow merchants to return funds to a cardholder after a successful payment. Get Central supports multiple refund flows depending on whether the original transaction data and/or the physical card are available at the time of the refund.
This guide applies to TPVPC Implantado. The standard refund flow uses the original transaction identifiers to execute a DEVOLUCION operation.

Requirements

Before initiating a refund, ensure the following conditions are met:

  • Get Central middleware initialized and operational
  • Refund capability enabled for the merchant and terminal
  • Original transaction data available, especially the TPVPC order number (pedido)

Refunds may be full or partial, depending on configuration and issuer rules.

Refund Models

Get Central supports the following refund scenarios:

  1. Refund using the original transaction identifiers
  2. Refund or confirmation from another terminal
  3. Refund with card present, where the original card is read again on the PIN Pad
  4. Refund without original, if enabled in the merchant configuration
All refund models use the same operation type: DEVOLUCION.

Refund Process

The standard refund flow is performed by invoking the refund/confirmation function with the original transaction identifiers. The middleware returns an XML response that must be validated to determine whether the refund was authorized.

Step 1: Execute a DEVOLUCION Operation

To execute a refund using the original transaction data, use:

  • fnDllOperComContable

The following parameters are required:

ParameterTypeRequiredDescription
cNumPedidoStringYesOrder number (pedido) of the original transaction.
cRTSOriginalStringNoRTS identifier of the original transaction. Recommended when available.
cImporteStringYesRefund amount in decimal format XXXXXXXXX.XX.
cFacturaStringYesMerchant reference for the refund operation.
cTipoOperStringYesMust be set to DEVOLUCION.
cXMLRespBufferYesOutput buffer that will receive the XML response.
iTamMaxRespIntegerYesMaximum size of the response buffer. Minimum recommended value: 8192.

The refund amount must be less than or equal to the original captured amount.

Here is an example of a referenced refund in C#:

csharp
StringBuilder xmlResponse = new StringBuilder(8192); int result = fnDllOperComContable( "123456", // cNumPedido "070001070319164116378278", // cRTSOriginal "5.00", // cImporte "REF-2024-001", // cFactura "DEVOLUCION", // cTipoOper xmlResponse, xmlResponse.Capacity );
For the web/JavaScript integration path, the same function can be executed through execFnDll, passing the original function name and arguments to the local TPVPC service.
A return value of 0 indicates that the operation was processed correctly at a technical level. It does not confirm authorization.
information icon
If the function returns -2, perform a query for the last operation to verify whether the refund was ultimately authorized.

Step 2: Validate the Refund Result

After execution, the middleware returns an XML response. A refund must be considered AUTHORIZED only if the response contains:
xml
<estado>F</estado> <resultado>Autorizada</resultado>
Any other combination must be treated as DENIED.

Here is an example of an authorized refund:

xml
<resultadoOperacion> <tipoPago>DEVOLUCION</tipoPago> <importe>5.00</importe> <moneda>978</moneda> <pedido>REF-2024-001</pedido> <estado>F</estado> <resultado>Autorizada</resultado> </resultadoOperacion>

Persistence Requirements

For reconciliation and auditing purposes, store at least:

  • Refund reference (cFactura)
  • Original transaction order number (pedido)
  • Original RTS identifier, when available
  • Authorization result and response codes

Additional Refund Scenarios

The TPVPC Implantado documentation also includes additional refund flows, including:

  • refunds or confirmations from another terminal
  • refunds with the original card read again on the PIN Pad
  • refunds without original transaction data

Use these flows only when they match your operational scenario.

Next Steps

After processing a refund, you can proceed with further reconciliation and management tasks: