# TPVPC: Quick Start: Your First Transaction

This quick start guide walks you through performing your **first test payment** using Get Central. By the end of this tutorial, you will have:

This guide applies to **TpvpcImplantado**.

* initialized the TPVPC,
* executed a payment operation using `PAGO`, and
* validated the transaction result using the XML response.

This guide focuses strictly on the **minimal happy path**, without covering advanced scenarios such as refunds, pre-authorizations, or recurring payments.

---

## Requirements

Before you begin, ensure the following prerequisites are met:

* **Get Central** (TPVPC) installed on a supported workstation
* **PIN pad hardware** connected and recognized by the operating system
* **Test credentials** (`cComercio`, `cTerminal`, `cClaveFirma`) provided by your acquirer

<Callout type="note">

Some installations support simulation or test environments. Availability depends on the credentials and configuration supplied by the acquirer.

</Callout>

---

## First Transaction Process

The first transaction consists of three mandatory steps:

1. Initialize the TPVPC
2. Execute a payment operation (`PAGO`)
3. Validate the transaction result

---

### Step 1: Initialize the TPVPC

Initialization must be performed **once per application lifecycle** before executing any operation. A successful initialization prepares communication with the PIN pad and enables payment execution.

| Parameter     | Type   | Required | Description                                                                 |
| ------------- | ------ | -------- | --------------------------------------------------------------------------- |
| `cComercio`   | String | Yes      | Merchant identifier assigned by the acquirer.                       |
| `cTerminal`   | String | Yes      | Terminal identifier associated with the PIN pad.                            |
| `cClaveFirma` | String | Yes      | Signature key assigned to the merchant and terminal.                        |
| `cConfPuerto` | String | No       | Communication port. If empty, the value is loaded from local configuration. |
| `cVersion`    | String | No       | Protocol version. If empty, the default configured version is used.         |

Here's an example of how to initialize the TPVPC:

```csharp
int result = fnDllIniTpvpcLatente(
    "99999999",     // cComercio
    "00000001",     // cTerminal
    "CLAVE123456",  // cClaveFirma
    "",             // cConfPuerto
    ""              // cVersion
);

if (result != 0)
{
    // Initialization failed. Do not proceed.
}
```

A return value of `0` indicates that the TPVPC is ready for operations. Any other value indicates a technical error.

---

### Step 2: Execute a Test Payment (`PAGO`)

Once initialization succeeds, you can execute a payment operation using `cTipoOper = "PAGO"`. This operation performs a standard card-present payment and captures the funds immediately.

| Parameter   | Type   | Required | Description                                                                |
| ----------- | ------ | -------- | -------------------------------------------------------------------------- |
| `cImporte`  | String | Yes      | Transaction amount in decimal format `XXXXXXXXX.XX` (for example, `1.00`). |
| `cFactura`  | String | Yes      | Unique merchant reference for the transaction.                             |
| `cTipoOper` | String | Yes      | Must be set to `PAGO`.                                                     |

<Callout type="warning">

The currency is determined by the terminal configuration and is **not** passed as a parameter in card-present payment operations.

</Callout>

Here's an example of how to execute a payment operation:

```csharp
StringBuilder xmlResponse = new StringBuilder(8192);

int result = fnDllOperPinPad(
    "1.00",        // cImporte
    "TEST0001",    // cFactura
    "PAGO",        // cTipoOper
    xmlResponse,
    xmlResponse.Capacity
);

if (result != 0)
{
    // Execution failed. Handle technical error.
}
```

When the operation starts, the PIN pad prompts the cardholder to insert, swipe, or tap the card. Once the operation completes, the XML response buffer is populated.

---

### Step 3: Validate the Transaction Result

After execution, the XML response must be parsed to determine whether the payment was authorized.

| XML Tag             | Type   | Description                                          |
| ------------------- | ------ | ---------------------------------------------------- |
| `<estado>`          | String | Execution state. Finalized operations use value `F`. |
| `<resultado>`       | String | Financial result (`Autorizada` or `Denegada`).       |
| `<codigoRespuesta>` | String | Authorization or response code returned by the host. |
| `<pedido>`          | String | Merchant reference (`cFactura`).                     |

The transaction must be considered **AUTHORIZED** only if the XML contains:

```xml
<estado>F</estado>
<resultado>Autorizada</resultado>
```

Any other combination must be treated as **DENIED**, even if the execution return code was `0`.

Persist the merchant reference and authorization data, as they are required for refunds, queries, and reconciliation.

---

## Next Steps

Now that you have processed your first transaction, you can deepen your integration by exploring:

* [Architecture](/en/get-central/first-steps/architecture) - A detailed view of the system components and data flow.
* [Process a Refund](/en/get-central/tpvpc-payment-guides/process-a-refund) - Learn how to reverse authorized payments.
* [Request Parameters Reference](/en/get-central/tpvpc-reference/request-parameters) - Complete list of technical arguments for all operations.