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

# Enums

> PaymentMode, PaymentStatus, and other enum types.

## PaymentMode

Controls how the SDK processes payments:

```ts theme={null}
enum PaymentMode {
  POOL        = 'POOL',         // Custodial — pay from company pool wallet
  SESSION_KEY = 'SESSION_KEY',  // Non-custodial — pay from user's wallet via session key
}
```

| Value         | When to use                                                 |
| ------------- | ----------------------------------------------------------- |
| `POOL`        | Custodial fintechs, expense tools, closed-loop payment apps |
| `SESSION_KEY` | Non-custodial wallets, DeFi apps, user-controlled funds     |

See [Payment Modes](/configuration/payment-modes) for a full comparison.

***

## PaymentStatus

The lifecycle status of a payment:

```ts theme={null}
enum PaymentStatus {
  PENDING    = 'pending',     // Created, not yet submitted to chain
  PROCESSING = 'processing',  // Submitted, awaiting confirmation
  CONFIRMED  = 'confirmed',   // Confirmed on-chain
  FAILED     = 'failed',      // Transaction failed or rejected
}
```

```ts theme={null}
import { PaymentStatus } from '@taprails/tap-to-pay';

if (result.status === PaymentStatus.CONFIRMED) {
  showSuccessScreen();
} else if (result.status === PaymentStatus.FAILED) {
  showErrorScreen();
}
```

***

## FlowType

Controls which UI flow `PaymentFlowManager` renders:

```ts theme={null}
type FlowType = 'merchant' | 'customer';
```

***

## FlowState

Union of all possible UI states across merchant and customer flows:

```ts theme={null}
type MerchantFlowState =
  | 'idle'
  | 'creating'
  | 'waiting'
  | 'processing'
  | 'success'
  | 'error';

type CustomerFlowState =
  | 'idle'
  | 'scanning'
  | 'confirming'
  | 'processing'
  | 'success'
  | 'error';

type FlowState = MerchantFlowState | CustomerFlowState;
```

***

## MerchantStatus

Controls whether a merchant can receive payments. Checked on every `payments/process` request.

```ts theme={null}
enum MerchantStatus {
  ACTIVE       // Normal operations — payments accepted
  PAUSED       // Self-service pause by the partner company
  FROZEN       // Platform-imposed hold (admin only)
  BLACKLISTED  // Permanent ban for fraud / non-compliance (admin only)
  SUSPENDED    // Temporary administrative hold (admin only)
}
```

See [MerchantStatus reference →](/api-reference/types/merchant-status) for full details on who can set each status and what happens to in-flight payments.
