> For the complete documentation index, see [llms.txt](https://docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verifone.com/psdk-latest/psdk-user-guide-and-training/psdk-user-guide/payment_functions/fi-payments.md).

# Fully Integrated Payments

FI (Fully Integrated) mode gives the POS application direct control over every step of the payment transaction. Unlike Semi Integration — where `startPayment()` hands off the full flow to the SDK — FI exposes each EMV step as an individual request/response pair so the POS drives card acquisition, cryptogram generation, and host authorization itself. Because the POS owns the transaction flow, it can perform any transaction type required by the host — Sale, Void, Refund, Void Refund, and others — interacting with the POI only through the FI API at each step as needed.

{% hint style="success" %}
**No login or session required.** Call `getFiManager()` directly after `initialize()` and `connect()` succeed. Login and session setup are only needed for Semi Integration.
{% endhint %}

***

## When to Use Fully Integrated (FI)

In FI Integration, the POS retains full control of the transaction flow. The POS decides what to do with the data, when to proceed to the next step, and how to handle host authorization. The FI API provides only the interface for the POS to interact with the device as needed at each step — requesting cardholder input, retrieving card data, updating transaction data, and requesting cryptogram generation (First Gen AC / Second Gen AC).

***

## Entry Points

| Mode                  | Entry Point                                | Session Required |
| --------------------- | ------------------------------------------ | ---------------- |
| Semi Integration      | `transactionManager.startPayment(payment)` | Yes              |
| Slim Integration      | `transactionManager.startPayment(payment)` | Yes              |
| **Fully Integration** | **`paymentSdk.getFiManager()`**            | **No**           |

{% hint style="warning" %}
If `getFiManager()` returns `null`, FI is not supported on this device or configuration. Confirm that the AGPA FI interface is enabled with your Verifone integration contact.
{% endhint %}

***

## Transaction Flow

The FI flow differs by card entry method. Check `FiCardData.getEntryMode()` after Card Acquisition to determine which path to follow — see [FiEntryMode](https://docs.verifone.com/psdk-api-latest/java/index/fientrymode) in the API Reference for all supported values.

### EMV Contact (chip) — 4 steps

```
Card Acquisition → First Gen AC → Host Authorization → Second Gen AC
```

The EMV kernel on the terminal performs cryptogram generation in two stages. First Gen AC generates the ARQC sent to the host; Second Gen AC finalises with a TC (approved) or AAC (declined) based on the host response.

Depending on the `quickChipMode` set in the Card Acquisition request, some steps can be combined:

* **`NON_QC_GEN_AC`** — Card Acquisition and First Gen AC are combined into a single step. Skip the separate `requestFiFirstGenAC()` call and proceed directly to host authorization.
* **`QC`** — Card Acquisition, First Gen AC, and Second Gen AC are all combined into a single step. The terminal completes the full EMV cryptogram flow internally and returns the final result in the Card Acquisition response.

### MSR / Contactless / Manual — 2 steps

```
Card Acquisition → Host Authorization
```

Non-chip entry methods complete after Card Acquisition. First Gen AC and Second Gen AC are not applicable and must not be called.

***

## Supported Transaction Types

All transaction types are passed as `FiTransactionType` in the Card Acquisition request. See [FiTransactionType](https://docs.verifone.com/psdk-api-latest/java/index/fitransactiontype) in the API Reference for all supported values (`PURCHASE`, `CASH_ADVANCE`, `VOID_PURCHASE`, `PAYMENT_WITH_CASH_BACK`, `REFUND`, `VOID_REFUND`, `BALANCE_INQUIRY`).

The transaction type is set once in `FiCardAcquisitionRequest` and must be consistent across all steps in the same transaction.

***

## QuickChip Mode

The `quickChipMode` parameter on `FiCardAcquisitionRequest` controls whether First Gen AC is performed inside Card Acquisition or as a separate call.

See [FiQuickChipMode](https://docs.verifone.com/psdk-api-latest/java/index/fiquickchipmode) in the API Reference for all Quick Chip processing modes (`NON_QC`, `QC`, `NON_QC_GEN_AC`).

***

## Online PIN

When the cardholder enters a PIN, the encrypted PIN block is available via `getFiOnlinePin()` — the location depends on the entry method and QuickChip mode:

* **CTLS, or ICC with QuickChip mode `NON_QC_GEN_AC` or `QC`** — PIN block is in `FiCardAcquisitionResponse.getFiOnlinePin()`
* **ICC with QuickChip mode `NON_QC`** — PIN block is in `FiFirstGenACResponse.getFiOnlinePin()`

In both cases, check that `getBypassed()` is `false` before reading the PIN data. The encrypted PIN block must be forwarded to your acquirer host — it is never decrypted by PSDK or the POS.

{% tabs %}
{% tab title="Java" %}
{% code title="Handle Online PIN" lineNumbers="true" %}

```java
Optional<FiOnlinePin> onlinePin = response.getFiOnlinePin();
if (onlinePin.isPresent() && !onlinePin.get().getBypassed()) {
    String encryptedPinBlock = onlinePin.get().getEncryptedData();
    String ksn             = onlinePin.get().getKSN();
    FiPinBlockFormat format = onlinePin.get().getBlockFormat();
    // Include in your host authorization request
}
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code title="Handle Online PIN" lineNumbers="true" %}

```kotlin
val onlinePin = response.fiOnlinePin
if (onlinePin != null && !onlinePin.bypassed) {
    val encryptedPinBlock = onlinePin.encryptedData
    val ksn = onlinePin.ksn
    val format = onlinePin.blockFormat
    // Include in your host authorization request
}
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code title="Handle Online PIN" lineNumbers="true" %}

```swift
if let onlinePin = response.fiOnlinePin, !onlinePin.isBypassed {
    let encryptedPinBlock = onlinePin.encryptedData
    let ksn = onlinePin.ksn
    let format = onlinePin.blockFormat
    // Include in your host authorization request
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}
{% code title="Handle Online PIN" lineNumbers="true" %}

```csharp
var onlinePin = response.GetFiOnlinePin();
if (onlinePin != null && !onlinePin.GetBypassed()) {
    string encryptedPinBlock = onlinePin.GetEncryptedData();
    string ksn = onlinePin.GetKSN();
    FiPinBlockFormat format = onlinePin.GetBlockFormat();
    // Include in your host authorization request
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

## Aborting a Transaction

Call `requestFiAbort()` at any point to cancel an in-flight FI operation:

{% tabs %}
{% tab title="Java" %}
{% code title="Abort FI operation" lineNumbers="true" %}

```java
fiManager.requestFiAbort(new FiAbortRequest(true /* clearDisplay */));
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code title="Abort FI operation" lineNumbers="true" %}

```kotlin
fiManager.requestFiAbort(FiAbortRequest(true /* clearDisplay */))
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code title="Abort FI operation" lineNumbers="true" %}

```swift
fiManager.requestFiAbort(FiAbortRequest(clearDisplay: true))
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}
{% code title="Abort FI operation" lineNumbers="true" %}

```csharp
fiManager.RequestFiAbort(new FiAbortRequest(true /* clearDisplay */));
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

## Response Codes

Every FI response includes a result code in `FiResponseResult`. The table below lists all defined codes.

| Code | Description                                                                                                                                      |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 000  | Operation successful                                                                                                                             |
| 001  | Invalid command code. The packet ID (DXX) is not recognized.                                                                                     |
| 002  | Invalid data format. One or more parameters are not valid.                                                                                       |
| 003  | Response has more packets. The resultant packet has more than 512 bytes and the remaining contents are immediately sent in an additional packet. |
| 004  | Previous step missing. Some mandatory step for the required task was not performed.                                                              |
| 005  | INVALID\_CONFIG                                                                                                                                  |
| 006  | TIMEOUT                                                                                                                                          |
| 007  | TIMER\_ERROR                                                                                                                                     |
| 008  | CANCELLED                                                                                                                                        |
| 009  | COMM\_FAILURE                                                                                                                                    |
| 010  | CHIP\_RDR\_FAILURE                                                                                                                               |
| 011  | BAD\_KEY                                                                                                                                         |
| 020  | USE\_CHIP\_READER                                                                                                                                |
| 021  | USE\_MAG\_STRIPE                                                                                                                                 |
| 022  | CHIP\_ERROR                                                                                                                                      |
| 023  | CARD\_REMOVED                                                                                                                                    |
| 024  | CARD\_BLOCKED                                                                                                                                    |
| 025  | CARD\_NOT\_SUPPORTED                                                                                                                             |
| 026  | BAD\_CARD                                                                                                                                        |
| 027  | DO\_ABSENT                                                                                                                                       |
| 028  | DO\_REPEAT                                                                                                                                       |
| 029  | INVALID\_PIN                                                                                                                                     |
| 030  | PIN\_LAST\_CHANCE                                                                                                                                |
| 031  | PIN\_RETRYLIMIT                                                                                                                                  |
| 032  | TLVCOLLECTION\_FULL                                                                                                                              |
| 033  | TLVFORMAT                                                                                                                                        |
| 034  | INVALID\_PDOL                                                                                                                                    |
| 035  | INVALID\_CDOL                                                                                                                                    |
| 036  | INVALID\_TDOL                                                                                                                                    |
| 037  | INVALID\_DDOL                                                                                                                                    |
| 038  | INVALID\_SDOL                                                                                                                                    |
| 039  | AID\_LIST\_FULL                                                                                                                                  |
| 040  | PSE\_NOT\_FOUND                                                                                                                                  |
| 041  | ICC\_DATA\_MISSING                                                                                                                               |
| 042  | CANDIDATELIST\_EMPTY                                                                                                                             |
| 043  | APDU\_FORMAT                                                                                                                                     |
| 044  | HASH\_FAILED                                                                                                                                     |
| 045  | BAD\_TRACK2                                                                                                                                      |
| 046  | CERTIFICATE\_EXPIRED                                                                                                                             |
| 047  | DIFF\_AVN\_ERR                                                                                                                                   |
| 048  | SERVICE\_NOT\_ALLOWED                                                                                                                            |
| 049  | APP\_NOTYET\_EFFECTIVE                                                                                                                           |
| 050  | APP\_EXPIRED                                                                                                                                     |
| 051  | LOWER\_LMT\_EXCEED                                                                                                                               |
| 052  | UPPER\_LMT\_EXCEED                                                                                                                               |
| 053  | CVM\_FAILED                                                                                                                                      |
| 054  | UNRECOGNIZED\_CVM                                                                                                                                |
| 055  | DECLINE                                                                                                                                          |
| 056  | BAD\_HASHALGO                                                                                                                                    |
| 057  | BAD\_IPKALGO                                                                                                                                     |
| 058  | INVALID\_LENGTH                                                                                                                                  |
| 059  | TAG\_NOTFOUND                                                                                                                                    |
| 060  | INVALID\_OFFSET                                                                                                                                  |
| 061  | BAD\_COMMAND                                                                                                                                     |
| 062  | TAG\_ALREADY\_PRESENT                                                                                                                            |
| 063  | READ\_RECORD\_FAILED                                                                                                                             |
| 064  | EXPLICIT\_SELEC\_REQD                                                                                                                            |
| 065  | COND\_NOT\_SATISFIED                                                                                                                             |
| 066  | CSN\_FAILURE                                                                                                                                     |
| 067  | BAD\_SLOT                                                                                                                                        |
| 068  | BAD\_LEN                                                                                                                                         |
| 069  | NO\_MEM                                                                                                                                          |
| 070  | CAPK\_ERROR                                                                                                                                      |
| 071  | PIN\_CONFIG\_ERR                                                                                                                                 |
| 072  | EST\_TAB\_ERR                                                                                                                                    |
| 073  | MVT\_TAB\_ERR                                                                                                                                    |
| 074  | SCRIPT\_ERROR                                                                                                                                    |
| 075  | LOG\_ERROR                                                                                                                                       |
| 076  | COMBINED\_DDA\_AC\_GEN\_REQD                                                                                                                     |
| 077  | COMBINED\_DDA\_AC\_GEN\_FAILED                                                                                                                   |
| 078  | CARD\_INSERTED                                                                                                                                   |
| 079  | NO\_KEYS                                                                                                                                         |
| 090  | EXTERNAL\_READER\_NOT\_PRESENT                                                                                                                   |
| 091  | CARD\_UNAVAILABLE                                                                                                                                |
| 092  | BAD\_SWIPE                                                                                                                                       |
| 097  | UNRECOG\_RETURN                                                                                                                                  |
| 098  | UNEXPECTED\_RETURN                                                                                                                               |
| 099  | FAIL                                                                                                                                             |

***

## Requirements

| Requirement  | Details                                                                                                                                                                                          |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PSDK version | 3.69.0 or later                                                                                                                                                                                  |
| PSDK mode    | FI requires the AGPA FI interface. Call `getFiManager()` — if it returns `null`, FI is not supported on this device or configuration. Confirm enablement with your Verifone integration contact. |
| Hardware     | Same as for Semi Integration running the AGPA and AGPA-FI applications on the terminal                                                                                                           |

{% hint style="info" %}
**See also**

* [FI Payments Code Lab](/psdk-latest/reference-material/code-labs/fi-payments.md) — step-by-step implementation walkthrough with full code samples
* [FiManager API Reference](https://docs.verifone.com/psdk-api-latest/java/index/fimanager) — API requests to the AGPA-FI application
* [CommerceListener2 API Reference](https://docs.verifone.com/psdk-api-latest/java/index/commercelistener2) — API to handle response events from the AGPA-FI application
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verifone.com/psdk-latest/psdk-user-guide-and-training/psdk-user-guide/payment_functions/fi-payments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
