> ## 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.

# PrimerSettings

```ts theme={"dark"}
interface PrimerSettings {
  paymentHandling?: 'AUTO' | 'MANUAL';
  localeData?: IPrimerLocaleData;
  paymentMethodOptions?: IPrimerPaymentMethodOptions;
  uiOptions?: IPrimerUIOptions;
  debugOptions?: IPrimerDebugOptions;
  clientSessionCachingEnabled?: boolean;
  apiVersion?: PrimerApiVersion;

  // Dropin UI
  onBeforeClientSessionUpdate?: () => void;
  onClientSessionUpdate?: (clientSession: PrimerClientSession) => void;
  onBeforePaymentCreate?: (checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) => void;
  onCheckoutComplete?: (checkoutData: PrimerCheckoutData) => void;
  onTokenizeSuccess?: (paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerTokenizationHandler) => void;
  onResumeSuccess?: (resumeToken: string, handler: PrimerResumeHandler) => void;
  onResumePending?: (additionalInfo: PrimerCheckoutAdditionalInfo) => void;
  onCheckoutReceivedAdditionalInfo?: (additionalInfo: PrimerCheckoutAdditionalInfo) => void;
  onError?: (error: PrimerError, checkoutData: PrimerCheckoutData | null, handler: PrimerErrorHandler | undefined) => void;
  onDismiss?: () => void;

  headlessUniversalCheckoutCallbacks?: {
    onAvailablePaymentMethodsLoad?: (availablePaymentMethods: any[]) => void;
    onTokenizationStart?: (paymentMethodType: string) => void;
    onTokenizationSuccess?: (paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerHeadlessUniversalCheckoutResumeHandler) => void;

    onCheckoutResume?: (resumeToken: string, handler: PrimerHeadlessUniversalCheckoutResumeHandler) => void;
    onCheckoutPending?: (additionalInfo: PrimerCheckoutAdditionalInfo) => void;
    onCheckoutAdditionalInfo?: (additionalInfo: PrimerCheckoutAdditionalInfo) => void;

    onError?: (error: PrimerError, checkoutData: PrimerCheckoutData | null) => void;
    onCheckoutComplete?: (checkoutData: PrimerCheckoutData) => void;
    onBeforeClientSessionUpdate?: () => void;

    onClientSessionUpdate?: (clientSession: PrimerClientSession) => void;
    onBeforePaymentCreate?: (checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) => void;
    onPreparationStart?: (paymentMethodType: string) => void;

    onPaymentMethodShow?: (paymentMethodType: string) => void;
  }
}

interface IPrimerLocaleData {
  languageCode?: string
  localeCode?: string
}

interface IPrimerPaymentMethodOptions {
  iOS?: {
    urlScheme?: string;
  }
  android?: {
    redirectScheme?: string;
  },
  apayaOptions?: IPrimerApayaOptions;
  applePayOptions?: IPrimerApplePayOptions;

  /**
  * @obsoleted The IPrimerCardPaymentOptions is obsoleted on v.2.14.0
  */
  cardPaymentOptions?: IPrimerCardPaymentOptions;

  goCardlessOptions?: IPrimerGoCardlessOptions;
  googlePayOptions?: IPrimerGooglePayOptions;
  klarnaOptions?: IPrimerKlarnaOptions;
  threeDsOptions?: IPrimerThreeDsOptions;
  stripeOptions?: IPrimerStripeOptions;
}

interface IPrimerApayaOptions {
  webViewTitle: string;
}

interface IPrimerApplePayOptions {
  merchantIdentifier: string;
  merchantName?: string;
  isCaptureBillingAddressEnabled?: boolean;
  showApplePayForUnsupportedDevice?: boolean;
  checkProvidedNetworks?: boolean;
  shippingOptions?: {
    shippingContactFields?: RequiredContactField[];
    requireShippingMethod: boolean;
  };
  billingOptions?: {
    requiredBillingContactFields?: RequiredContactField[];
  };
}

type RequiredContactField = 'name' | 'emailAddress' | 'phoneNumber' | 'postalAddress';

interface IPrimerCardPaymentOptions {
  is3DSOnVaultingEnabled: boolean;
}

interface IPrimerGoCardlessOptions {
  businessName?: string;
  businessAddress?: string;
}

interface IPrimerGooglePayOptions {
  merchantName?: string;
  allowedCardNetworks?: string[];
  isCaptureBillingAddressEnabled?: boolean;
  isExistingPaymentMethodRequired?: boolean;
  shippingAddressParameters?: IPrimerGoogleShippingAddressParameters;
  requireShippingMethod?: boolean;
  emailAddressRequired?: boolean;
  buttonOptions?: IPrimerGooglePayButtonOptions;
}

interface IPrimerGooglePayButtonOptions {
  buttonType?: number;
  buttonTheme?: number;
}

interface IPrimerGoogleShippingAddressParameters {
  isPhoneNumberRequired?: boolean;
}

interface IPrimerKlarnaOptions {
  recurringPaymentDescription?: string;
  webViewTitle?: string;
}

interface IPrimerUIOptions {
  isInitScreenEnabled?: boolean;
  isSuccessScreenEnabled?: boolean;
  isErrorScreenEnabled?: boolean;
  dismissalMechanism?: DismissalMechanism[];
  appearanceMode?: PrimerAppearanceMode;
  theme?: IPrimerTheme;
  cardFormUIOptions?: IPrimerCardFormUIOptions;
}

export type DismissalMechanism = 'gestures' | 'closeButton';

export type PrimerAppearanceMode = 'SYSTEM' | 'LIGHT' | 'DARK';

interface IPrimerDebugOptions {
  is3DSSanityCheckEnabled?: boolean;
}

export type PrimerApiVersion = '2.4' | 'latest'

interface IPrimerThreeDsOptions {
  iOS?: {
    threeDsAppRequestorUrl?: string;
  };
  android?: {
    threeDsAppRequestorUrl?: string;
  };
}

interface IPrimerCardFormUIOptions {
  payButtonAddNewCard?: boolean;
}
```

## Appearance Mode Configuration

You can control the SDK's appearance mode independently of the system setting using the `appearanceMode` property in `uiOptions`. This is particularly useful for apps that implement their own theme management.

### Example

```typescript theme={"dark"}
import { Primer, PrimerSettings } from '@primer-io/react-native';

const settings: PrimerSettings = {
  paymentHandling: 'AUTO',
  uiOptions: {
    appearanceMode: 'LIGHT', // Options: 'SYSTEM' (default), 'LIGHT', 'DARK'
    isInitScreenEnabled: true,
    isSuccessScreenEnabled: true,
    isErrorScreenEnabled: true
  }
};

// Configure Primer with the settings
await Primer.configure(settings);
```

This feature is especially helpful when:

* Your app has an "Always Light" or "Always Dark" mode setting
* You want to maintain consistent appearance across the payment flow
* You need to override the system's dark mode setting for specific user preferences

⚠️ If no settings are provided, the SDK will initialize with its default settings. <br />
Use `PrimerSettings` to provide different options based on your use case.

<Expandable title="Properties" defaultOpen>
  <ResponseField name="paymentHandling" type="String" post={["optional"]}>
    Can be set to `'MANUAL'` or `'AUTO'`
    Force the SDK locale. By default, the locale will be set to the device's locale.
  </ResponseField>

  <ResponseField name="localeData" type="IPrimerLocaleData" post={["optional"]}>
    {"Forces some payment methods' locale."}

    <Expandable title="properties">
      <ResponseField name="languageCode" type="String">
        Forces the language code (e.g. `en`). Defaults on your app's language code if available.
      </ResponseField>

      <ResponseField name="localeCode" type="String">
        Forces the locale code (e.g. `US`). Defaults on your app's country locale code if available.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="paymentMethodOptions" type="IPrimerPaymentMethodOptions" post={["optional"]}>
    Customize the appearance and behavior of the card fields in the checkout form for various payment methods

    <Expandable title="Properties">
      <ResponseField name="iOS" type="object" post={["optional"]}>
        <Expandable title="Properties">
          <ResponseField name="urlScheme" type="String" post={["optional"]}>
            ⚠️ Required for some payment methods (e.g. PayPal). <br />

            <br />

            This option sets the deeplink schema used when redirecting back from 3rd
            party applications to your app.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="android" type="object" post={["optional"]}>
        <Expandable title="Properties">
          <ResponseField name="redirectScheme" type="String" post={["optional"]}>
            ⚠️ Required for some payment methods (e.g. PayPal). <br />

            <br />

            This option sets the deeplink schema used when redirecting back from 3rd
            party applications to your app.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="applePayOptions" type="IPrimerApplePayOptions" post={["optional"]}>
        Options for using Apple Pay as a payment method.

        <Expandable title="Properties">
          <ResponseField name="merchantIdentifier" type="String">
            {
                                "Set it to the merchant identifier as it is shown in your Apple Pay certificate."
                              }
          </ResponseField>

          <ResponseField name="merchantName" type="String">
            {"Deprecated: Use Client Session API to provide merchant name value."}
          </ResponseField>

          <ResponseField name="isCaptureBillingAddressEnabled" type="Boolean">
            Defaults to `false`. Set to `true` to let Apple Pay capture the customer's billing address.

            {"Deprecated: Use BillingOptions to configure required billing fields."}
          </ResponseField>

          <ResponseField name="showApplePayForUnsupportedDevice" type="Boolean">
            If in some cases you don't want to present ApplePay option if the device is not supporting it set this to `false`. The default value is `true`.

            {
                                "Default value is `true`. Set to `false` if you do not want to present Apple Pay option on unsupported devices."
                              }
          </ResponseField>

          <ResponseField name="checkProvidedNetworks" type="Boolean">
            <Warning>
              This is an advanced configuration flag. You should discuss it with the Primer team before using it.
            </Warning>

            If set to `true`, only merchant-allowed card networks can be used when paying with Apple Pay. If set to `false` any network can be used provided the device supports Apple Pay.

            Merchant-allowed networks are provided using [`orderedAllowedCardNetworks`](/api-reference/v2.4/api-reference/client-session-api/create-a-client-session#body-payment-method-ordered-allowed-card-networks) when creating the client session.

            {
                                "Default value is `true`. This flag supports the old behavior where Apple Pay flow might not present if there are no cards in the Wallet."
                              }
          </ResponseField>

          <ResponseField name="shippingOptions" type="ShippingOptions">
            {"Configure shipping options for Apple Pay."}

            <Expandable title="Properties">
              <ResponseField name="shippingContactFields" type="Array of RequiredContactField">
                {"Specify which contact fields are required for shipping."}
              </ResponseField>

              <ResponseField name="requireShippingMethod" type="Boolean">
                {"Indicate if a shipping method is required."}
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="billingOptions" type="BillingOptions">
            {"Configure billing options for Apple Pay."}

            <Expandable title="Properties">
              <ResponseField name="requiredBillingContactFields" type="Array of RequiredContactField">
                {"Specify which contact fields are required for billing."}
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="cardPaymentOptions" type="IPrimerCardPaymentOptions" deprecated>
        ⚠️ This option is `Deprecated` since v.2.14.0.

        <Expandable title="Properties">
          <ResponseField name="is3DSOnVaultingEnabled" type="Boolean">
            {"Enable 3DS flow on vaulted cards."}
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="goCardlessOptions" type="IPrimerGoCardlessOptions" post={["optional"]}>
        ⚠️ Required when using Go Cardless in your integration.

        <Expandable title="Properties">
          <ResponseField name="businessName" type="String">
            {"Business name."}
          </ResponseField>

          <ResponseField name="businessAddress" type="String">
            {"Business address."}
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="googlePayOptions" type="IPrimerGooglePayOptions" post={["optional"]}>
        ⚠️ Required when using Google Pay in your integration.

        <Expandable title="Properties">
          <ResponseField name="merchantName" type="String">
            Set it the merchant name that you want to be shown on the Google Pay
            screen.
          </ResponseField>

          <ResponseField name="allowedCardNetworks" type="Array<String>" post={['"AMEX", "DISCOVER", "JCB", "MASTERCARD", "VISA"']}>
            Sets the [card networks](https://developers.google.com/pay/api-reference/android/guides/tutorial#supported-card-networks) that your application accepts.
          </ResponseField>

          <ResponseField name="isCaptureBillingAddressEnabled" type="Boolean" post={["Default false"]}>
            Sets whether user's billing address should be captured from Google Pay.
          </ResponseField>

          <ResponseField name="isExistingPaymentMethodRequired" type="Boolean" post={["Default false"]}>
            If set to `true`, this specifies that Google Pay can only be used for payments if the user's Google Pay wallet already contains allowed payment methods.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="klarnaOptions" type="IPrimerKlarnaOptions" post={["optional"]}>
        ⚠️ Required when using Klarna in your integration.

        <Expandable title="Properties">
          <ResponseField name="recurringPaymentDescription" type="String" post={["optional"]}>
            Set the payment description that will be shown on the Klarna screen.
          </ResponseField>

          <ResponseField name="webViewTitle" type="String" post={["optional"]}>
            ⚠️ This option is `Deprecated`.<br />Sets the toolbar title of the Activity displaying Klarna views.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="threeDsOptions" type="IPrimerThreeDsOptions">
        Sets the 3DS options in the SDK.

        <Expandable title="Properties">
          <ResponseField name="iOS" type="object" post={["optional"]}>
            <Expandable title="Properties">
              <ResponseField name="threeDsAppRequestorUrl" type="String" post={["optional"]}>
                Set the [iOS Universal Link](https://developer.apple.com/ios/universal-links/) that's used to call your app after an **out-of-band (OOB)** authentication.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="android" type="object" post={["optional"]}>
            <Expandable title="Properties">
              <ResponseField name="threeDsAppRequestorUrl" type="String" post={["optional"]}>
                Set the [App link](https://developer.android.com/training/app-links) that's used to call your app after an **out-of-band (OOB)** authentication.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="stripeOptions" type="IPrimerStripeOptions" post={["optional"]}>
        ⚠️ Required when using Stripe ACH in your integration.

        <Expandable title="Properties">
          <ResponseField name="publishableKey" type="String" post={["required"]}>
            Set the [Stripe publishable
            key](https://docs.stripe.com/keys#obtain-api-keys).
          </ResponseField>

          <ResponseField name="mandateData" type="IPrimerStripeTemplateMandateData | IPrimerFullMandateData" post={["optional"]}>
            Data used for mandate in Drop-in

            <Expandable>
              <ResponseField name="IPrimerStripeTemplateMandateData">
                Data for the mandate allowing you to specify the name of the
                merchant that would be used in a predefined mandate template.

                <Expandable title="Properties">
                  <ResponseField name="merchantName" type="String" post={["required"]}>
                    The name of the merchant.
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="IPrimerFullMandateData">
                Data for the mandate allowing you to specify the full mandate.

                <Expandable title="Properties">
                  <ResponseField name="fullMandateText" type="String" post={["required"]}>
                    The string resource pointing to the full mandate. Supported on
                    Android and iOS.
                  </ResponseField>

                  <ResponseField name="fullMandateStringResourceName" type="String" post={["optional"]}>
                    The name of the Android string resource pointing to the full
                    mandate. Supported only on Android.
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="uiOptions" type="IPrimerUIOptions" post={["optional"]}>
    <Expandable title="Properties">
      <ResponseField name="isInitScreenEnabled" type="Boolean" post={["optional"]}>
        Set to `false` to hide the loading screen before the Universal Checkout or the Vault Manager. Defaults to `true`.
      </ResponseField>

      <ResponseField name="isSuccessScreenEnabled" type="Boolean" post={["optional"]}>
        Set to `false` to hide the screen after a successful payment, or tokenization on the vault flow. Defaults to `true`.
      </ResponseField>

      <ResponseField name="isErrorScreenEnabled" type="Boolean" post={["optional"]}>
        Set to `false` to hide the error screen when an error occurs. Defaults to `true`.
      </ResponseField>

      <ResponseField name="dismissalMechanism" type="DismissalMechanism[]" post={["Default: [gestures]"]}>
        Set the mechanism for dismissing Universal Checkout. Options are:

        * `gestures`: The dialog can be dismissed by tapping outside or by swiping down.
        * `closeButton`: A close button is provided, allowing users to dismiss the dialog manually.
      </ResponseField>

      <ResponseField name="theme" type="IPrimerTheme" post={["optional"]}>
        {'Set a custom theme for Primer SDK.'}
      </ResponseField>

      <ResponseField name="cardFormUIOptions" type="IPrimerCardFormUIOptions" post={["optional"]}>
        Configure the card form UI options.

        <Expandable title="Properties" defaultOpen>
          <ResponseField name="payButtonAddNewCard" type="Boolean" post={["optional"]}>
            When set to true, the Drop-In's card form pay button will show "Add new card"; otherwise it will show "Pay \$x.xx".
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="debugOptions" type="IPrimerDebugOptions" post={["optional"]}>
    <Expandable title="Properties">
      <ResponseField name="is3DSSanityCheckEnabled" type="Boolean" post={["optional"]}>
        {'Debug option on 3DS for Primer SDK.'}
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="clientSessionCachingEnabled" type="boolean" post={["optional"]}>
    <Warning>
      Before enabling flag to true it's recommended to reach out to Primer support
      for additional verification since there are edge cases where it's not advised.
    </Warning>

    Indicates whether client session caching is enabled.

    When set to `true`, responses from the server will be cached on the client side, allowing for faster subsequent
    access to the same data within the cache duration. When set to `false`, every request to the server will be
    processed without utilizing any client-side cache, ensuring that the client always receives the most up-to-date data.
  </ResponseField>

  <ResponseField name="apiVersion" type="PrimerApiVersion" post={["optional"]}>
    Indicates the API version to use when interacting with the Primer backend. Options are:

    * `2.4` - will use ApiVersion 2.4

    Note that this is optional, if a value is not supplied, ApiVersion `V2.4` will be used by default.
  </ResponseField>

  <ResponseField name="onBeforeClientSessionUpdate" type="() => void" post={["optional"]}>
    {'Called when the client session is in the process of being updated. Use it to show a loading indicator on your UI.'}
  </ResponseField>

  <ResponseField name="onClientSessionUpdate" type="(clientSession: PrimerClientSession) => void" post={["optional"]}>
    {'Called when the client session has been updated by the checkout. Returns the updated client session which can be used to inform your UI. For example updating tax, shipping or discount amounts displayed to your customers.'}
  </ResponseField>

  <ResponseField name="onBeforePaymentCreate" type="(checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) => void" post={["optional"]}>
    Called when a payment will be created.
    Use as an opportunity to update UI accordingly - for example, to display a "loading" component.
    The `handler` must be used to then abort or continue with payment creation.
    Primer will continue with payment creation if `onBeforePaymentCreate` is not implemented.

    <Expandable title="Parameters">
      <ResponseField name="checkoutPaymentMethodData" type="PrimerCheckoutPaymentMethodData">
        <Expandable title="Parameters">
          <ResponseField name="paymentMethodType" type="String">
            The type of the payment method Primer will use for payment creation, one of [PaymentMethodType](/sdk/web/v2.x.x/constants/payment-method-types)
          </ResponseField>

          <ResponseField name="paymentMethod" type="String">
            The name of the payment method Primer will use for payment creation.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="handler" type="PrimerPaymentCreationHandler">
        Provides two methods to continue or abort the payment.<br /> You MUST call one of the methods of the handler if `onBeforePaymentCreate` is implemented.

        <Expandable title="Parameters">
          <ResponseField name="abortPaymentCreation" type="(errorMessage: string | null) => void">
            Choose to abort a payment.
          </ResponseField>

          <ResponseField name="continuePaymentCreation" type="() => void">
            Choose to continue with payment creation
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="onCheckoutComplete" type="(checkoutData: PrimerCheckoutData) => void" post={["optional"]}>
    Called when a payment has been created. Move on to next step in your checkout flow, such as showing a success message, etc.

    <Expandable title="Parameters">
      <ResponseField name="checkoutData" type="PrimerCheckoutData">
        <Expandable title="Properties" defaultOpen>
          <ResponseField name="payment" type="IPrimerCheckoutDataPayment">
            <Expandable title="Properties">
              <ResponseField name="id" type="string">
                Primer's unique identifier for the payment.
              </ResponseField>

              <ResponseField name="orderId" type="string">
                Your order identifier as provided in the client session.
              </ResponseField>

              <ResponseField name="paymentFailureReason" type="PrimerPaymentErrorCode">
                Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="additionalInfo" type="object">
            Custom information, that depends on the payment method.

            <Expandable title="Variations">
              <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="couponCode" type="String" required />

                  <ResponseField name="retailerName" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="PromptPayCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="qrCodeUrl" type="String?" />

                  <ResponseField name="qrCodeBase64" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="MultibancoCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="entity" type="String" required />

                  <ResponseField name="reference" type="String" required />
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  {" "}

  <ResponseField name="onTokenizeSuccess" type="(paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerTokenizationHandler) => void" post={["optional"]}>
    <Note>
      If you set `paymentHandling` to `MANUAL`, implementing this is mandatory.
    </Note>

    <Expandable title="Parameters">
      <ResponseField name="paymentMethodTokenData" type="PrimerPaymentMethodTokenData">
        <Expandable title="Properties" defaultOpen>
          <ResponseField name="analyticsId" type="string">
            An unique identifier for the payment instrument token.
          </ResponseField>

          <ResponseField name="id" type="string">
            Payment method identifier.
          </ResponseField>

          <ResponseField name="isVaulted" type="boolean">
            Indicating the use of vaulted instruments for the payment method.
          </ResponseField>

          <ResponseField name="paymentInstrumentData" type="PaymentInstrumentData">
            Additional information about the payment instrument.
            Depending on the payment method type, only some of the following properties are present on the object.

            <Expandable title="Properties">
              <ResponseField name="network" type="string?">
                The human readable representation of card network (e.g., Visa, Mastercard).
              </ResponseField>

              <ResponseField name="cardholderName" type="string?">
                The name of the cardholder.
              </ResponseField>

              <ResponseField name="first6Digits" type="number?">
                The first 6 digits of the card number.
              </ResponseField>

              <ResponseField name="last4Digits" type="number?">
                The last 4 digits of the card number.
              </ResponseField>

              <ResponseField name="accountNumberLast4Digits" type="number?">
                The last 4 digits of the account number.
              </ResponseField>

              <ResponseField name="expirationMonth" type="number?">
                The expiration month of the card, in 2-digit format.
              </ResponseField>

              <ResponseField name="expirationYear" type="number?">
                The expiration year of the card, in 4-digit format.
              </ResponseField>

              <ResponseField name="externalPayerInfo" type="IExternalPayerInfo?">
                Additional PayPal data.

                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="email" type="string">
                    The payer's email address.
                  </ResponseField>

                  <ResponseField name="externalPayerId" type="string?">
                    The payer's unique ID.
                  </ResponseField>

                  <ResponseField name="firstName" type="string?">
                    The payer's given name.
                  </ResponseField>

                  <ResponseField name="lastName" type="string">
                    The payer's given surname.
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="klarnaCustomerToken" type="string?" />

              <ResponseField name="sessionData" type="IKlarnaSessionData?" />

              <ResponseField name="paymentMethodType" type="string?">
                A unique string identifier for the payment method. (e.g. `PAYPAL`, `GOOGLE_PAY`)
              </ResponseField>

              <ResponseField name="binData" type="IBinData?">
                Additional BIN data.

                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="network" type="string?">
                    The card network (e.g., VISA, MASTERCARD, AMEX).
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="bankName" type="string?">
                The name of the bank.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="paymentInstrumentType" type="string">
            The type of the payment instrument.

            Example of possible values (new values could be added as we add new payment methods):

            * `APPLE_PAY`
            * `CARD_OFF_SESSION_PAYMENT`
            * `GOOGLE_PAY`
            * `KLARNA_CUSTOMER_TOKEN`
            * `OFF_SESSION_PAYMENT`
            * `PAYMENT_CARD`
            * `PAYPAL_BILLING_AGREEMENT`
            * `PAYPAL_ORDER`
          </ResponseField>

          <ResponseField name="token" type="string" required>
            The payment instrument token you can use to [create a payment request](/api-reference/v2.4/api-reference/payments-api/create-a-payment) from your backend.
          </ResponseField>

          <ResponseField name="tokenType" type="&#x22;SINGLE_USE&#x22; | &#x22;MULTI_USE&#x22;">
            Whether this payment method token can be used only once or multiple times.
          </ResponseField>

          <ResponseField name="threeDSecureAuthentication" type="ThreeDSAuthenticationData">
            <Expandable title="Properties">
              <ResponseField name="responseCode" type="ThreeDSecureStatus">
                Indicates the outcome of the 3D Secure authentication process.\
                Possible values:

                * `AUTH_SUCCESS`: The authentication was successful.
                * `AUTH_FAILED`: The authentication process failed.
                * `SKIPPED`: The authentication was skipped.
                * `CHALLENGE`: A challenge was issued during the authentication process.
              </ResponseField>

              <ResponseField name="reasonCode" type="string">
                An optional code indicating the reason for the outcome of the 3D Secure authentication.
              </ResponseField>

              <ResponseField name="reasonText" type="string">
                An optional text description providing further details about the reason for the authentication outcome.
              </ResponseField>

              <ResponseField name="protocolVersion" type="string">
                Specifies the version of the 3D Secure protocol that was used.
              </ResponseField>

              <ResponseField name="challengeIssued" type="boolean">
                Indicates whether a challenge was issued as part of the authentication process.

                * `true`: A challenge was issued.
                * `false`: No challenge was issued.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="vaultData" type="PrimerVaultData">
            <Expandable title="Properties">
              <ResponseField name="customerId" type="string">
                The `customerId` associated to the payment method, if vaulted.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="handler" type="OnTokenizeSuccessHandler">
        <Expandable title="Properties">
          <ResponseField name="handleSuccess" type="() => void">
            Display a success screen.
          </ResponseField>

          <ResponseField name="handleFailure" type="(errorMessage: string) => void">
            Display `errorMessage` as an error or failure message.
          </ResponseField>

          <ResponseField name="continueWithNewClientToken" type="(clientToken: string) => void">
            Continue the payment flow using the given `clientToken`.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>

    Called after a customer submitted their payment data and the payment details have been tokenized.
    You'll receive a `paymentMethodToken` in `onTokenizeSuccess()`.

    * [Create a payment request](/api-reference/v2.4/api-reference/payments-api/create-a-payment) passing the `paymentMethodToken` to your backend

    * If the payment is successful, call `handler.handleSuccess()` in order to display a success screen

    * If the payment is unsuccessful, call `handler.handleFailure(errorMessage)` to display an error or failure message

    * Payments API may return a new `clientToken` for additional steps (in the `requiredActions` on the response). In this case, call `handler.continueWithNewClientToken(clientToken)` to continue with the payment flow
  </ResponseField>

  {" "}

  <ResponseField name="onResumeSuccess" type="(resumeToken: string, handler: PrimerResumeHandler) => void" post={["optional"]}>
    <Expandable title="Parameters">
      <ResponseField name="resumeToken" type="string">
        The resume token you can use to [resume the payment flow](/api-reference/v2.4/api-reference/payments-api/resume-a-payment) on your backend.
      </ResponseField>

      <ResponseField name="handler">
        <Expandable title="Properties">
          <ResponseField name="handleSuccess" type="() => void">
            Display a success screen.
          </ResponseField>

          <ResponseField name="handleFailure" type="(errorMessage: string) => void">
            {"Display `errorMessage` as an error or failure message."}
          </ResponseField>

          <ResponseField name="continueWithNewClientToken" type="(clientToken: string) => void">
            Continue the payment flow using the given `clientToken`.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="onResumePending" type="(additionalInfo: PrimerCheckoutAdditionalInfo) => void" post={["optional"]}>
    This callback is triggered when the payment is not authorized as it's an asynchronous alternative payment method, such as a voucher payment method.

    <Warning>
      This method will be called only when using the `PrimerPaymentHandling` is set to `MANUAL`
    </Warning>

    <Expandable title="Properties">
      <ResponseField name="additionalInfo" type="PrimerCheckoutAdditionalInfo" required>
        <Expandable title="variations">
          <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="XenditCheckoutVoucherAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="couponCode" type="String" required />

              <ResponseField name="retailerName" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="PromptPayCheckoutAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="PromptPayCheckoutAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="qrCodeUrl" type="String?" />

              <ResponseField name="qrCodeBase64" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="MultibancoCheckoutAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="MultibancoCheckoutAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="entity" type="String" required />

              <ResponseField name="reference" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="DisplayStripeAchMandateAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="DisplayStripeAchMandateAdditionalInfo">
                The name of this additional info.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="onCheckoutReceivedAdditionalInfo" type="(additionalInfo: PrimerCheckoutAdditionalInfo) => void" post={["optional"]}>
    This callback is triggered when the payment is not authorized as it’s an asynchronous alternative payment method, such as a voucher payment method.

    <Warning>
      This method will be called only when using the `PrimerPaymentHandling` is set to `AUTO`
    </Warning>

    <Expandable title="Parameters">
      <ResponseField name="additionalInfo" type="PrimerCheckoutAdditionalInfo" required>
        <Expandable title="variations">
          <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="XenditCheckoutVoucherAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="couponCode" type="String" required />

              <ResponseField name="retailerName" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="PromptPayCheckoutAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="PromptPayCheckoutAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="qrCodeUrl" type="String?" />

              <ResponseField name="qrCodeBase64" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="MultibancoCheckoutAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="MultibancoCheckoutAdditionalInfo">
                The name of this additional info.
              </ResponseField>

              <ResponseField name="expiresAt" type="String" required />

              <ResponseField name="entity" type="String" required />

              <ResponseField name="reference" type="String" required />
            </Expandable>
          </ResponseField>

          <ResponseField name="DisplayStripeAchMandateAdditionalInfo">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="additionalInfoName" type="DisplayStripeAchMandateAdditionalInfo">
                The name of this additional info.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="onError" type="(error: PrimerError, checkoutData: PrimerCheckoutData | null, handler: PrimerErrorHandler | undefined) => void" post={["optional"]}>
    This method will be called when an error occurs. It may return `PrimerCheckoutData` if the error occurs after the payment creation.

    <Note>
      Please note, that if you `override` this method, you *must* call the `errorHandler` to finalize the flow.
    </Note>

    <Expandable title="Properties">
      <ResponseField name="error" type="PrimerError" required>
        <Expandable title="Properties">
          <ResponseField name="errorId" type="String" required>
            A unique error identifier.
          </ResponseField>

          <ResponseField name="errorCode" type="String?">
            A unique error code.
          </ResponseField>

          <ResponseField name="description" type="String" required>
            A error description.
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="checkoutData" type="PrimerCheckoutData">
        <Expandable title="Properties" defaultOpen>
          <ResponseField name="payment" type="IPrimerCheckoutDataPayment">
            <Expandable title="Properties">
              <ResponseField name="id" type="string">
                Primer's unique identifier for the payment.
              </ResponseField>

              <ResponseField name="orderId" type="string">
                Your order identifier as provided in the client session.
              </ResponseField>

              <ResponseField name="paymentFailureReason" type="PrimerPaymentErrorCode">
                Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="additionalInfo" type="object">
            Custom information, that depends on the payment method.

            <Expandable title="Variations">
              <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="couponCode" type="String" required />

                  <ResponseField name="retailerName" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="PromptPayCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="qrCodeUrl" type="String?" />

                  <ResponseField name="qrCodeBase64" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="MultibancoCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="entity" type="String" required />

                  <ResponseField name="reference" type="String" required />
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="handler" type="PrimerErrorHandler">
        <Expandable title="Methods">
          <ResponseField name="showErrorMessage(errorMessage: String | null)">
            Call with your custom error message.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="onDismiss" type="() => void" post={["optional"]}>
    This method will be called to notify you that the Primer SDK has been
    dismissed.
  </ResponseField>

  <ResponseField name="headlessUniversalCheckoutCallbacks" type="object">
    <Expandable title="Properties">
      <ResponseField name="onAvailablePaymentMethodsLoad" type="(availablePaymentMethods: any[]) => void">
        Called when the available payment methods have been loaded. Takes an array of objects as its argument.

        <Expandable title="Parameters">
          <ResponseField name="paymentMethods" type="PaymentMethodInfo[]">
            <Expandable title="Properties">
              <ResponseField name="type" type="PaymentMethodType" required>
                <ConfigurePaymentMethodType />
              </ResponseField>

              <ResponseField name="managerType" type="&#x22;CARD&#x22; | &#x22;NATIVE&#x22; | &#x22;REDIRECT&#x22;" required>
                The type of payment manager to use.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onTokenizationStart" type="(paymentMethodType: string) => void">
        This method will be called with just before the tokenization gets started.

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

      <ResponseField name="onTokenizationSuccess" type="(paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerHeadlessUniversalCheckoutResumeHandler) => void">
        This method will be called when the tokenization was successful.
      </ResponseField>

      <ResponseField name="onCheckoutResume" type="(resumeToken: string, handler: PrimerHeadlessUniversalCheckoutResumeHandler) => void">
        <Expandable title="Parameters">
          <ResponseField name="resumeToken" type="string">
            The resume token you can use to [resume the payment flow](/api-reference/v2.4/api-reference/payments-api/resume-a-payment) on your backend.
          </ResponseField>

          <ResponseField name="handler" type="PrimerHeadlessUniversalCheckoutResumeHandler">
            <Expandable title="Properties">
              <ResponseField name="complete" type="() => void">
                Complete the payment flow.
              </ResponseField>

              <ResponseField name="continueWithNewClientToken" type="(clientToken: string) => void">
                Continue the payment flow using the given `clientToken`.
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onCheckoutPending" type="(additionalInfo: PrimerCheckoutAdditionalInfo) => void">
        This callback is triggered when the payment is not authorized as it's an asynchronous alternative payment method, such as a voucher payment method.

        <Warning>
          This method will be called only when using the `PrimerPaymentHandling` is set to `MANUAL`
        </Warning>

        <Expandable title="Properties">
          <ResponseField name="additionalInfo" type="PrimerCheckoutAdditionalInfo" required>
            <Expandable title="variations">
              <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="XenditCheckoutVoucherAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="couponCode" type="String" required />

                  <ResponseField name="retailerName" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="PromptPayCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="PromptPayCheckoutAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="qrCodeUrl" type="String?" />

                  <ResponseField name="qrCodeBase64" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="MultibancoCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="MultibancoCheckoutAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="entity" type="String" required />

                  <ResponseField name="reference" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="DisplayStripeAchMandateAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="DisplayStripeAchMandateAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onCheckoutAdditionalInfo" type="(additionalInfo: PrimerCheckoutAdditionalInfo) => void">
        This callback is triggered when the payment is not authorized as it’s an asynchronous alternative payment method, such as a voucher payment method.

        <Warning>
          This method will be called only when using the `PrimerPaymentHandling` is set to `AUTO`
        </Warning>

        <Expandable title="Parameters">
          <ResponseField name="additionalInfo" type="PrimerCheckoutAdditionalInfo" required>
            <Expandable title="variations">
              <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="XenditCheckoutVoucherAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="couponCode" type="String" required />

                  <ResponseField name="retailerName" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="PromptPayCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="PromptPayCheckoutAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="qrCodeUrl" type="String?" />

                  <ResponseField name="qrCodeBase64" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="MultibancoCheckoutAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="MultibancoCheckoutAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>

                  <ResponseField name="expiresAt" type="String" required />

                  <ResponseField name="entity" type="String" required />

                  <ResponseField name="reference" type="String" required />
                </Expandable>
              </ResponseField>

              <ResponseField name="DisplayStripeAchMandateAdditionalInfo">
                <Expandable title="Properties" defaultOpen>
                  <ResponseField name="additionalInfoName" type="DisplayStripeAchMandateAdditionalInfo">
                    The name of this additional info.
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onError" type="(error: PrimerError, checkoutData: PrimerCheckoutData | null) => void">
        This method will be called when an error occurs. It may return `PrimerCheckoutData` if the error occurs after the payment creation.

        <Expandable title="Properties">
          <ResponseField name="error" type="PrimerError" required>
            <Expandable title="Properties">
              <ResponseField name="errorId" type="String" required>
                A unique error identifier.
              </ResponseField>

              <ResponseField name="errorCode" type="String?">
                A unique error code.
              </ResponseField>

              <ResponseField name="description" type="String" required>
                A error description.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="checkoutData" type="PrimerCheckoutData">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="payment" type="IPrimerCheckoutDataPayment">
                <Expandable title="Properties">
                  <ResponseField name="id" type="string">
                    Primer's unique identifier for the payment.
                  </ResponseField>

                  <ResponseField name="orderId" type="string">
                    Your order identifier as provided in the client session.
                  </ResponseField>

                  <ResponseField name="paymentFailureReason" type="PrimerPaymentErrorCode">
                    Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="additionalInfo" type="object">
                Custom information, that depends on the payment method.

                <Expandable title="Variations">
                  <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="couponCode" type="String" required />

                      <ResponseField name="retailerName" type="String" required />
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="PromptPayCheckoutAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="qrCodeUrl" type="String?" />

                      <ResponseField name="qrCodeBase64" type="String" required />
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="MultibancoCheckoutAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="entity" type="String" required />

                      <ResponseField name="reference" type="String" required />
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onCheckoutComplete" type="(checkoutData: PrimerCheckoutData) => void">
        Called when a payment has been created. Move on to next step in your checkout flow, such as showing a success message, etc.

        <Expandable title="Parameters">
          <ResponseField name="checkoutData" type="PrimerCheckoutData">
            <Expandable title="Properties" defaultOpen>
              <ResponseField name="payment" type="IPrimerCheckoutDataPayment">
                <Expandable title="Properties">
                  <ResponseField name="id" type="string">
                    Primer's unique identifier for the payment.
                  </ResponseField>

                  <ResponseField name="orderId" type="string">
                    Your order identifier as provided in the client session.
                  </ResponseField>

                  <ResponseField name="paymentFailureReason" type="PrimerPaymentErrorCode">
                    Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.
                  </ResponseField>
                </Expandable>
              </ResponseField>

              <ResponseField name="additionalInfo" type="object">
                Custom information, that depends on the payment method.

                <Expandable title="Variations">
                  <ResponseField name="XenditCheckoutVoucherAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="couponCode" type="String" required />

                      <ResponseField name="retailerName" type="String" required />
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="PromptPayCheckoutAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="qrCodeUrl" type="String?" />

                      <ResponseField name="qrCodeBase64" type="String" required />
                    </Expandable>
                  </ResponseField>

                  <ResponseField name="MultibancoCheckoutAdditionalInfo">
                    <Expandable title="Properties" defaultOpen>
                      <ResponseField name="expiresAt" type="String" required />

                      <ResponseField name="entity" type="String" required />

                      <ResponseField name="reference" type="String" required />
                    </Expandable>
                  </ResponseField>
                </Expandable>
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onBeforeClientSessionUpdate" type="() => void">
        Called when the client session is in the process of being updated. Use it to show a loading indicator on your app.
      </ResponseField>

      <ResponseField name="onClientSessionUpdate" type="(clientSession: PrimerClientSession) => void">
        Called when the client session has been updated by the checkout. Returns the updated client session which can be
        used to inform your UI. For example updating tax, shipping or discount amounts displayed to your customers.
      </ResponseField>

      <ResponseField name="onBeforePaymentCreate" type="(checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) => void">
        Called when a payment will be created.
        Use as an opportunity to update UI accordingly - for example, to display a "loading" component.
        The `handler` must be used to then abort or continue with payment creation.
        Primer will continue with payment creation if `onBeforePaymentCreate` is not implemented.

        <Expandable title="Parameters">
          <ResponseField name="checkoutPaymentMethodData" type="PrimerCheckoutPaymentMethodData">
            <Expandable title="Parameters">
              <ResponseField name="paymentMethodType" type="String">
                The type of the payment method Primer will use for payment creation, one of [PaymentMethodType](/sdk/web/v2.x.x/constants/payment-method-types)
              </ResponseField>

              <ResponseField name="paymentMethod" type="String">
                The name of the payment method Primer will use for payment creation.
              </ResponseField>
            </Expandable>
          </ResponseField>

          <ResponseField name="handler" type="PrimerPaymentCreationHandler">
            Provides two methods to continue or abort the payment.<br /> You MUST call one of the methods of the handler if `onBeforePaymentCreate` is implemented.

            <Expandable title="Parameters">
              <ResponseField name="abortPaymentCreation" type="(errorMessage: string | null) => void">
                Choose to abort a payment.
              </ResponseField>

              <ResponseField name="continuePaymentCreation" type="() => void">
                Choose to continue with payment creation
              </ResponseField>
            </Expandable>
          </ResponseField>
        </Expandable>
      </ResponseField>

      <ResponseField name="onPreparationStart" type="(paymentMethodType: string) => void">
        This method will be called when the SDK starts preparing to tokenize the payment method.
      </ResponseField>

      <ResponseField name="onPaymentMethodShow" type="(paymentMethodType: string) => void">
        Called when the payment method is displayed.
      </ResponseField>
    </Expandable>
  </ResponseField>
</Expandable>
