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

# usePrimerPaymentMethod

> One hook for any payment method: pass its type, check the kind, and start it.

> [!WARNING]
>
> Primer Checkout React Native SDK is currently in **beta** (v3.0.0-beta.1).
> The API is subject to change before the stable release.

`usePrimerPaymentMethod` gives you the state and actions for one payment method, by its type (for example `'PAYMENT_CARD'`, `'KLARNA'` or `'ADYEN_BLIK'`). The return value depends on how the method is driven, so check its `kind` first, then render the UI that kind needs and call its actions. The native SDK runs the payment, and the result arrives in [`usePrimerCheckout().paymentOutcome`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout).

Call it in a component inside [`PrimerCheckoutProvider`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/primer-checkout-provider); it throws outside one. Rendering the hook does no native work: native calls start when you call an action such as `start()`.

## Signature

```tsx theme={"dark"}
function usePrimerPaymentMethod(type: string): UsePrimerPaymentMethodReturn
```

| Parameter | Type | Description |
| - | - | - |
| `type` | `string` | Payment method type, as in [`PaymentMethodItem.type`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/payment-methods/primer-payment-method-list#paymentmethoditem). |

`UsePrimerPaymentMethodReturn` is a union. Narrow it on `kind`:

```tsx theme={"dark"}
import { Text } from 'react-native';
import { usePrimerPaymentMethod } from '@primer-io/react-native';

function KlarnaOption() {
  const method = usePrimerPaymentMethod('KLARNA');

  if (method.kind !== 'klarna' || !method.isAvailable) {
    return null;
  }

  return <Text>Pay later with Klarna</Text>;
}
```

The package exports the variant types `NativeUiPaymentMethod`, `CardPaymentMethod`, `StripeAchPaymentMethod` and `UnsupportedPaymentMethod`.

```tsx theme={"dark"}
import type { UsePrimerPaymentMethodReturn } from '@primer-io/react-native';

type KlarnaMethod = Extract<UsePrimerPaymentMethodReturn, { kind: 'klarna' }>;
```

## Kinds

The kind comes from the method's manager category in the session, checked in this order. `PAYMENT_CARD` is always `card`.

| `kind` | Payment methods | Flow |
| - | - | - |
| `card` | `PAYMENT_CARD` | Your card form: `start()`, then `PrimerCardFormProvider` with `PrimerCardForm` or the card inputs. |
| `nativeUi` | Methods with the `NATIVE_UI` category, such as Apple Pay (iOS), Google Pay (Android), PayPal, iDEAL and other redirect methods | `start()` opens the native sheet or the browser. |
| `bankSelection` | Methods with the `COMPONENT_WITH_REDIRECT` category | Bank list, then a redirect to the bank. |
| `klarna` | Klarna (`KLARNA` category) | Payment categories, Klarna's embedded view, then authorization. |
| `stripeAch` | Stripe ACH (`STRIPE_ACH` category) | Account holder details, Stripe's bank link, then the mandate. |
| `rawDataForm` | `ADYEN_BANCONTACT_CARD`, `ADYEN_MBWAY`, `ADYEN_BLIK` | A short form, then submit. |
| `unsupported` | Every other method, and any type that isn't in the session | None. Render nothing for it. |

A type that isn't in the session is `unsupported`, except `PAYMENT_CARD`, which is `card` with `isAvailable: false`.

> [!WARNING]
>
> Every variant has `isAvailable`. When it is `false`, render nothing for that method: its actions can't take a payment.

### Fields every kind shares

| Field | Kinds | Description |
| - | - | - |
| `kind` | All | The kind, as in the table above. |
| `isAvailable` | All | Whether the method can be used in this session on this device. |
| `paymentOutcome` | All except `card` and `unsupported` | The provider's single payment outcome, shared by every method: the same value as `usePrimerCheckout().paymentOutcome`. |
| `clearPaymentOutcome()` | All except `unsupported` | Sets the payment outcome back to `null`. |

## Native UI

`kind: 'nativeUi'` (type `NativeUiPaymentMethod`). The native SDK presents the payment sheet or opens the browser.

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | Google Pay: `true` on Android when it is in the session. Apple Pay: `true` on iOS when it is in the session. Any other method: `true` when it is in the session. |
| `isLoading` | `boolean` | `true` from `start()` until the payment ends. A shopper who closes the native sheet ends it with an error outcome. |
| `paymentOutcome` | `PaymentOutcome \| null` | See [Fields every kind shares](#fields-every-kind-shares). |
| `availabilityError` | `PaymentMethodAvailabilityError \| null` | Why the method isn't available, or `null` when it is. |

| Method | Description |
| - | - |
| `start(): Promise<void>` | Clears the payment outcome and presents the method. Returns without doing anything while another native-UI payment is in progress. When `isAvailable` is `false` for Google Pay or Apple Pay, it rejects with a `PrimerError` whose `errorId` is `google-pay-unavailable` or `apple-pay-unavailable`, and the payment outcome doesn't change. When the native SDK fails to present the method, it sets an error outcome and rejects. The result of the payment arrives in `paymentOutcome`. |
| `cancel(): void` | Clears `isLoading`. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null`. |

`PaymentMethodAvailabilityError` is `{ code: string; message: string }`. `code` is `PLATFORM_NOT_SUPPORTED` for a wallet the device's platform doesn't support, `NOT_READY` for Google Pay on an Android device that isn't ready to pay, and `NOT_AVAILABLE` otherwise. `message` is for your logs.

```tsx theme={"dark"}
import { Button } from 'react-native';
import { usePrimerPaymentMethod } from '@primer-io/react-native';

function NativePayButton({ type, title }: { type: string; title: string }) {
  const method = usePrimerPaymentMethod(type);

  if (method.kind !== 'nativeUi' || !method.isAvailable) {
    return null;
  }

  return (
    <Button
      title={title}
      disabled={method.isLoading}
      onPress={() => {
        method.start().catch(() => {});
      }}
    />
  );
}
```

> [!TIP]
>
> [`PrimerPaymentMethodList`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/payment-methods/primer-payment-method-list) draws Apple's own Apple Pay button on iOS and Google's own Google Pay button on Android.

## Card

`kind: 'card'` (type `CardPaymentMethod`). The card form is yours to render: see [`PrimerCardForm`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/card-form/primer-card-form) and [`usePrimerCardForm`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/card-form/use-primer-card-form).

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | `true` when `PAYMENT_CARD` is in the session. |

| Method | Description |
| - | - |
| `start(): void` | Activates the native card manager. It doesn't render or navigate. `usePrimerCardForm().submit()` does nothing until `start()` has run. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null`. |

The result of the card payment arrives in [`usePrimerCheckout().paymentOutcome`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout).

```tsx theme={"dark"}
import { useEffect } from 'react';
import { Button } from 'react-native';
import {
  PrimerCardForm,
  PrimerCardFormProvider,
  usePrimerCardForm,
  usePrimerPaymentMethod,
} from '@primer-io/react-native';

function CardPayment() {
  const card = usePrimerPaymentMethod('PAYMENT_CARD');
  const start = card.kind === 'card' && card.isAvailable ? card.start : undefined;

  useEffect(() => {
    start?.();
  }, [start]);

  return (
    <PrimerCardFormProvider>
      <PrimerCardForm />
      <PayButton />
    </PrimerCardFormProvider>
  );
}

function PayButton() {
  const { isValid, submit } = usePrimerCardForm();
  return <Button title="Pay" disabled={!isValid} onPress={() => void submit()} />;
}
```

## Bank selection

`kind: 'bankSelection'`. The shopper picks a bank, then the native SDK redirects to it.

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | `true` when the method is in the session. |
| `isLoading` | `boolean` | `true` while the bank list loads, and from `submit()` until the payment ends. |
| `paymentOutcome` | `PaymentOutcome \| null` | See [Fields every kind shares](#fields-every-kind-shares). |
| `banks` | `IssuingBank[]` | The banks to choose from. Empty until `start()` has loaded them. |
| `selectedBankId` | `string \| null` | The bank the shopper picked. |

| Method | Description |
| - | - |
| `start(): Promise<void>` | Clears the payment outcome and loads the bank list. |
| `filter(text: string): void` | Filters `banks` by name. |
| `selectBank(bankId: string): void` | Selects a bank. Required before `submit()`. |
| `submit(): Promise<void>` | Clears the payment outcome and starts the redirect to the selected bank. The result arrives in `paymentOutcome`. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null`. |

`IssuingBank`:

| Field | Type | Description |
| - | - | - |
| `id` | `string` | Bank id. Pass it to `selectBank`. |
| `name` | `string` | Bank name. |
| `iconUrl` | `string` | Bank logo URL. |
| `disabled` | `boolean` | When `true`, show the bank but don't let the shopper pick it. |

```tsx theme={"dark"}
import { useEffect } from 'react';
import { Button, Pressable, Text, View } from 'react-native';
import { usePrimerPaymentMethod } from '@primer-io/react-native';

function BankPayment({ type }: { type: string }) {
  const method = usePrimerPaymentMethod(type);
  const start = method.kind === 'bankSelection' && method.isAvailable ? method.start : undefined;

  useEffect(() => {
    void start?.();
  }, [start]);

  if (method.kind !== 'bankSelection' || !method.isAvailable) {
    return null;
  }

  const { banks, selectedBankId, isLoading, selectBank, submit } = method;

  return (
    <View>
      {banks.map((bank) => (
        <Pressable key={bank.id} disabled={bank.disabled} onPress={() => selectBank(bank.id)}>
          <Text style={{ fontWeight: bank.id === selectedBankId ? '600' : '400' }}>{bank.name}</Text>
        </Pressable>
      ))}
      <Button title="Pay" disabled={!selectedBankId || isLoading} onPress={() => void submit()} />
    </View>
  );
}
```

## Raw-data form

`kind: 'rawDataForm'`, for `ADYEN_BANCONTACT_CARD`, `ADYEN_MBWAY` and `ADYEN_BLIK`. You collect a few values and send them to the native SDK.

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | `true` when the method is in the session. |
| `requiredInputs` | `InputElementType[]` | The inputs the method needs, as reported by the native SDK. Empty until the native manager is ready after `start()`. |
| `validationErrors` | `string[]` | Validation messages from the native SDK. Use `isValid` to decide whether the shopper can pay. |
| `isValid` | `boolean` | The native SDK's verdict on the data sent with `setData`. |
| `paymentOutcome` | `PaymentOutcome \| null` | See [Fields every kind shares](#fields-every-kind-shares). |

| Method | Description |
| - | - |
| `start(): Promise<void>` | Activates the method's native manager. `requiredInputs` fills when the manager is ready. |
| `setData(data: RawData): Promise<void>` | Sends the method's data to the native SDK, which validates it and updates `isValid`. It can reject when the native SDK can't read the data. |
| `submit(): Promise<void>` | Submits the data. Disable your pay button until `isValid` is `true`. The result arrives in `paymentOutcome`. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null`. |

Before `start()` has activated the method, `setData` and `submit` do nothing. Wait until `requiredInputs` is filled before you collect data.

| Method | `requiredInputs` | `setData` payload |
| - | - | - |
| `ADYEN_MBWAY` | `PHONE_NUMBER` | `{ phoneNumber }` (type `PhoneNumberData`) |
| `ADYEN_BANCONTACT_CARD` | `CARD_NUMBER`, `EXPIRY_DATE`, `CARDHOLDER_NAME` | `{ cardNumber, expiryDate, cardholderName }` (type `BancontactCardData`) |
| `ADYEN_BLIK` | One input, for the BLIK code | `{ otp }` |

```tsx theme={"dark"}
import { useEffect, useState } from 'react';
import { ActivityIndicator, Button, TextInput, View } from 'react-native';
import { usePrimerPaymentMethod } from '@primer-io/react-native';
import type { PhoneNumberData } from '@primer-io/react-native';

function MbWayPayment() {
  const method = usePrimerPaymentMethod('ADYEN_MBWAY');
  const start = method.kind === 'rawDataForm' && method.isAvailable ? method.start : undefined;
  const [phoneNumber, setPhoneNumber] = useState('');

  useEffect(() => {
    void start?.();
  }, [start]);

  if (method.kind !== 'rawDataForm' || !method.isAvailable) {
    return null;
  }
  if (method.requiredInputs.length === 0) {
    return <ActivityIndicator />;
  }

  const onChangeText = (text: string) => {
    setPhoneNumber(text);
    const data: PhoneNumberData = { phoneNumber: text };
    method.setData(data).catch(() => {});
  };

  return (
    <View>
      <TextInput value={phoneNumber} onChangeText={onChangeText} keyboardType="phone-pad" />
      <Button title="Pay" disabled={!method.isValid} onPress={() => void method.submit()} />
    </View>
  );
}
```

## Klarna

`kind: 'klarna'`. The shopper picks a Klarna payment category, Klarna's own view loads inside your screen, and the shopper authorizes.

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | `true` when Klarna is in the session. |
| `paymentCategories` | `KlarnaPaymentCategory[]` | Klarna's payment categories for this session. Empty until `start()` has loaded them. |
| `selectedCategoryId` | `string \| null` | The category the shopper picked. |
| `isViewLoaded` | `boolean` | `true` once Klarna's view for the selected category has loaded. Render `PrimerKlarnaPaymentView` then. |
| `isLoading` | `boolean` | `true` while the Klarna session starts, and while an authorization runs. |
| `paymentOutcome` | `PaymentOutcome \| null` | See [Fields every kind shares](#fields-every-kind-shares). |

| Method | Description |
| - | - |
| `start(): Promise<void>` | Clears the payment outcome and starts a Klarna session, which loads `paymentCategories`. |
| `selectCategory(categoryId: string): void` | Selects a category and loads Klarna's view for it. Ids that aren't in `paymentCategories` are ignored. |
| `authorize(): Promise<void>` | Clears the payment outcome and authorizes the payment. When Klarna needs a separate finalization, the SDK sends it for you. The result arrives in `paymentOutcome`. |
| `finalize(): Promise<void>` | Finalizes the payment yourself. It does nothing when a finalization was already sent for this authorization, so you rarely need it. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null` and ends the Klarna flow: categories, selection and view reset. |

`KlarnaPaymentCategory`:

| Field | Type | Description |
| - | - | - |
| `identifier` | `string` | Category id. Pass it to `selectCategory`. |
| `name` | `string` | Category name to show the shopper. |
| `descriptiveAssetUrl` | `string` | URL of the category's descriptive image. |
| `standardAssetUrl` | `string` | URL of the category's standard image. |

> [!WARNING]
>
> Set `settings.paymentMethodOptions.klarnaOptions.returnIntentUrl` and handle that URL in your app, as described in [Native setup](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/guides/native-setup.md).

### PrimerKlarnaPaymentView

`PrimerKlarnaPaymentView` is the native view that shows Klarna's content for the selected category. Render it once `isViewLoaded` is `true`.

| Prop | Type | Default | Description |
| - | - | - | - |
| `style` | `StyleProp<ViewStyle>` | — | Style of the view. Give it a width and a height. |
| `onContentHeightChange` | `(event: NativeSyntheticEvent<{ height: number }>) => void` | — | Called with Klarna's content height in React Native layout units when it loads and each time it changes. |

Start from a fixed height, such as 250, and update it from `onContentHeightChange`.

```tsx theme={"dark"}
import { useEffect, useState } from 'react';
import { Button, Pressable, Text, View } from 'react-native';
import { PrimerKlarnaPaymentView, usePrimerPaymentMethod } from '@primer-io/react-native';

function KlarnaPayment() {
  const method = usePrimerPaymentMethod('KLARNA');
  const start = method.kind === 'klarna' && method.isAvailable ? method.start : undefined;
  const [viewHeight, setViewHeight] = useState(250);

  useEffect(() => {
    void start?.();
  }, [start]);

  if (method.kind !== 'klarna' || !method.isAvailable) {
    return null;
  }

  const { paymentCategories, selectedCategoryId, isViewLoaded, isLoading, selectCategory, authorize } = method;

  return (
    <View>
      {paymentCategories.map((category) => (
        <Pressable key={category.identifier} onPress={() => selectCategory(category.identifier)}>
          <Text style={{ fontWeight: category.identifier === selectedCategoryId ? '600' : '400' }}>
            {category.name}
          </Text>
        </Pressable>
      ))}
      {selectedCategoryId && isViewLoaded ? (
        <PrimerKlarnaPaymentView
          style={{ width: '100%', height: viewHeight }}
          onContentHeightChange={(event) => {
            const height = Math.ceil(event.nativeEvent.height);
            if (height > 0) setViewHeight(height);
          }}
        />
      ) : null}
      <Button title="Continue" disabled={!isViewLoaded || isLoading} onPress={() => void authorize()} />
    </View>
  );
}
```

## Stripe ACH

`kind: 'stripeAch'` (type `StripeAchPaymentMethod`). The shopper enters the account holder's details, links a bank account in Stripe's screen, then accepts a mandate.

It needs the Stripe dependency from [Native setup](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/guides/native-setup.md) and these settings on the provider:

* `settings.paymentMethodOptions.stripeOptions.publishableKey`: your Stripe publishable key.
* `settings.paymentMethodOptions.stripeOptions.mandateData`: either `{ merchantName }`, which fills the SDK's mandate text (in the device language), or `{ fullMandateText }`, your own text, shown as it is. Without either, the attempt ends with the error `stripe-ach-mandate-config`.

| Field | Type | Description |
| - | - | - |
| `isAvailable` | `boolean` | `true` when Stripe ACH is in the session. |
| `step` | `StripeAchStep` | Where the flow is. Drives which screen you render. |
| `userDetails` | `StripeAchUserDetails` | `{ firstName, lastName, emailAddress }`. Filled from the client session when it has them. |
| `fieldErrors` | `StripeAchFieldErrors` | Validation message per field from the native SDK (`firstName`, `lastName`, `emailAddress`). A missing key means the field is valid or hasn't been checked yet. |
| `isValid` | `boolean` | `true` while no field has an error. |
| `mandate` | `StripeAchMandateDisplay \| null` | The mandate to show: `{ text, source }`, where `source` is `'fullMandateText'` or `'template'`. Set while the mandate waits for an answer and while the answer is being sent. |
| `paymentOutcome` | `PaymentOutcome \| null` | See [Fields every kind shares](#fields-every-kind-shares). |

| `step` | Meaning |
| - | - |
| `idle` | No Stripe ACH flow is active. |
| `starting` | `start()` was called and the native component is starting. |
| `collectingDetails` | Show the details form. |
| `submittingDetails` | `submit()` is sending the details. |
| `awaitingBankLink` | Stripe's bank-link screen is open. |
| `mandatePending` | Show `mandate.text` and ask the shopper to accept or decline. |
| `answeringMandate` | The shopper's answer is being sent. |

| Method | Description |
| - | - |
| `start(): Promise<void>` | Clears the payment outcome and starts the flow. Does nothing when the flow is already active for this method. |
| `setFirstName(value: string): Promise<void>` | Updates `userDetails.firstName` and validates it. |
| `setLastName(value: string): Promise<void>` | Updates `userDetails.lastName` and validates it. |
| `setEmailAddress(value: string): Promise<void>` | Updates `userDetails.emailAddress` and validates it. |
| `submit(): Promise<void>` | Sends the details. Stripe's bank-link screen opens next. |
| `acceptMandate(): Promise<void>` | Accepts the mandate and completes the payment. Ignored unless `step` is `mandatePending`. |
| `declineMandate(): Promise<void>` | Declines the mandate. The attempt ends with an error outcome. Ignored unless `step` is `mandatePending`. |
| `clearPaymentOutcome(): void` | Sets the payment outcome back to `null`. |

See [Handle the payment result](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/guides/handle-payment-result.md) for the outcomes.

```tsx theme={"dark"}
import { useEffect } from 'react';
import { ActivityIndicator, Button, Text, TextInput, View } from 'react-native';
import { usePrimerPaymentMethod } from '@primer-io/react-native';

function StripeAchPayment() {
  const method = usePrimerPaymentMethod('STRIPE_ACH');
  const start = method.kind === 'stripeAch' && method.isAvailable ? method.start : undefined;

  useEffect(() => {
    void start?.();
  }, [start]);

  if (method.kind !== 'stripeAch' || !method.isAvailable) {
    return null;
  }

  const { step, userDetails, fieldErrors, isValid, mandate } = method;

  if (step === 'mandatePending' && mandate) {
    return (
      <View>
        <Text>{mandate.text}</Text>
        <Button title="Accept" onPress={() => void method.acceptMandate()} />
        <Button title="Decline" onPress={() => void method.declineMandate()} />
      </View>
    );
  }

  if (step === 'collectingDetails') {
    const isComplete = Boolean(userDetails.firstName && userDetails.lastName && userDetails.emailAddress);
    return (
      <View>
        <TextInput value={userDetails.firstName} onChangeText={(v) => void method.setFirstName(v)} />
        {fieldErrors.firstName ? <Text>{fieldErrors.firstName}</Text> : null}
        <TextInput value={userDetails.lastName} onChangeText={(v) => void method.setLastName(v)} />
        {fieldErrors.lastName ? <Text>{fieldErrors.lastName}</Text> : null}
        <TextInput
          value={userDetails.emailAddress}
          onChangeText={(v) => void method.setEmailAddress(v)}
          keyboardType="email-address"
          autoCapitalize="none"
        />
        {fieldErrors.emailAddress ? <Text>{fieldErrors.emailAddress}</Text> : null}
        <Button title="Continue" disabled={!isValid || !isComplete} onPress={() => void method.submit()} />
      </View>
    );
  }

  return <ActivityIndicator />;
}
```

## Unsupported

`kind: 'unsupported'` (type `UnsupportedPaymentMethod`) is `{ kind: 'unsupported'; isAvailable: false }`. The method can't be used in this session. Render nothing for it.

## End a flow

When the shopper leaves your screen for a bank-selection, Klarna or Stripe ACH method, end the flow with `stopBanks()`, `stopKlarna()` or `stopAch()` from [`usePrimerCheckout()`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout), as the prebuilt sheet does when the shopper goes back to its method list. Then `start()` begins a new flow the next time your screen opens.

## Errors

Payment failures, such as a declined card, a 3DS failure or a network error, arrive in `paymentOutcome`. The hook also ends attempts with its own errors.

| `errorId` | When |
| - | - |
| `google-pay-unavailable`, `apple-pay-unavailable` | `start()` on a wallet that isn't available. `start()` rejects; `paymentOutcome` doesn't change. |
| `native-ui-start-failed` | The native SDK couldn't present a native-UI method. |
| `bank-selection-start-failed` | The bank list couldn't be loaded. |
| `klarna-start-failed` | The Klarna session couldn't start. |
| `stripe-ach-unavailable`, `stripe-ach-start-failed` | The Stripe ACH flow couldn't start, for example when the Stripe dependency is missing. |
| `stripe-ach-submit-failed` | `submit()` failed. `step` goes back to `collectingDetails`. |
| `stripe-ach-mandate-config` | `mandateData` has neither `merchantName` nor `fullMandateText`. |
| `stripe-ach-mandate-failed` | `acceptMandate()` failed. |
| `stripe-ach-decline-failed` | `declineMandate()` itself failed. |

The `*-start-failed`, `*-submit-failed`, `*-mandate-failed` and `*-decline-failed` ids wrap a failure that didn't come as a `PrimerError`; when it did, you get that error instead. See [`PrimerError`](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/common/primer-error) for its fields.

## See also

> [card] [PrimerPaymentMethodList](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/payment-methods/primer-payment-method-list.md)
>
> List the session's payment methods.

> [card] [usePrimerCheckout](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/use-primer-checkout.md)
>
> The payment outcome and checkout state.

> [card] [Native setup](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/guides/native-setup.md)
>
> URL schemes, wallets and the Klarna and Stripe dependencies.

> [card] [PrimerError](https://primer.io/docs/sdk/react-native-checkout/v3.0.0-beta/api/common/primer-error.md)
>
> Error fields and where errors arrive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.