> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PrimerHeadlessUniversalCheckoutUiListener

## Overview

Set the `PrimerHeadlessUniversalCheckoutUiListener` in order to receive different UI callbacks from Primer SDK.

### onPreparationStarted

This method will be called when the SDK starts preparing to tokenize the payment method.

```kotlin KOTLIN theme={"dark"}
fun onPreparationStarted(paymentMethodType: String)
```

### Parameters

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="paymentMethodType" type="String" required>
    {}
  </ResponseField>
</Expandable>

### onPaymentMethodShowed

This method will be called when the payment method UI gets displayed.

```kotlin KOTLIN theme={"dark"}
fun onPaymentMethodShowed(paymentMethodType: String)
```

<Expandable title="Parameters" defaultOpen>
  <ResponseField name="paymentMethodType" type="String" required />
</Expandable>
