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

# PrimerQRCodeScope

> API reference for QR code payment method scopes

`PrimerQRCodeScope` manages payment methods that display a QR code for the user to scan (e.g., PromptPay, Xfers). The SDK automatically polls for completion after the QR code is displayed.

## Declaration

```swift theme={"dark"}
@MainActor
public protocol PrimerQRCodeScope: PrimerPaymentMethodScope where State == PrimerQRCodeState
```

## Properties

| Property | Type                             | Description                     |
| -------- | -------------------------------- | ------------------------------- |
| `state`  | `AsyncStream<PrimerQRCodeState>` | Stream of QR code state changes |

### Customization

| Property | Type                     | Description                                                               |
| -------- | ------------------------ | ------------------------------------------------------------------------- |
| `screen` | `QRCodeScreenComponent?` | Full screen replacement. Signature: `(any PrimerQRCodeScope) -> any View` |

<Info>
  This scope inherits `start()`, `cancel()`, `onBack()`, `presentationContext`, and `dismissalMechanism` from [PrimerPaymentMethodScope](/sdk/ios-checkout/v3.0.0-beta/configuration/scopes-overview#base-protocol). QR code scopes do not use `submit()` — the payment completes when the user scans the QR code in their banking app.
</Info>

## PrimerQRCodeState

```swift theme={"dark"}
public struct PrimerQRCodeState: Equatable {
  public enum Status: Equatable {
    case loading
    case displaying
    case success
    case failure(String)
  }

  var status: Status
  var paymentMethod: CheckoutPaymentMethod?
  var qrCodeImageData: Data?
}
```

### Flow

```mermaid theme={"dark"}
stateDiagram-v2
    [*] --> loading
    loading --> displaying
    displaying --> success
    displaying --> failure
```

| Property          | Type                     | Description                                                      |
| ----------------- | ------------------------ | ---------------------------------------------------------------- |
| `status`          | `Status`                 | Current payment status                                           |
| `paymentMethod`   | `CheckoutPaymentMethod?` | Payment method details                                           |
| `qrCodeImageData` | `Data?`                  | QR code image data (PNG). Available when status is `.displaying` |

## Payment methods

| Payment Method | Region   |
| -------------- | -------- |
| PromptPay      | Thailand |
| Xfers          | Thailand |

## See also

<CardGroup cols={2}>
  <Card title="Scopes overview" icon="diagram-project" href="/sdk/ios-checkout/v3.0.0-beta/configuration/scopes-overview">
    All available scopes
  </Card>
</CardGroup>
