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

# PrimerWebRedirectScope

> API reference for web redirect payment method scopes

`PrimerWebRedirectScope` manages payment methods that redirect the user to an external web page to complete payment (e.g., Twint).

## Declaration

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

## Properties

| Property            | Type                                  | Description                                      |
| ------------------- | ------------------------------------- | ------------------------------------------------ |
| `paymentMethodType` | `String`                              | Payment method type identifier (e.g., `"TWINT"`) |
| `state`             | `AsyncStream<PrimerWebRedirectState>` | Stream of web redirect state changes             |

### Customization

| Property           | Type                          | Description                                                                    |
| ------------------ | ----------------------------- | ------------------------------------------------------------------------------ |
| `screen`           | `WebRedirectScreenComponent?` | Full screen replacement. Signature: `(any PrimerWebRedirectScope) -> any View` |
| `payButton`        | `WebRedirectButtonComponent?` | Custom pay button. Signature: `(any PrimerWebRedirectScope) -> any View`       |
| `submitButtonText` | `String?`                     | Submit button label                                                            |

<Info>
  This scope inherits `start()`, `submit()`, `cancel()`, `onBack()`, `presentationContext`, and `dismissalMechanism` from [PrimerPaymentMethodScope](/sdk/ios-checkout/v3.0.0-beta/configuration/scopes-overview#base-protocol).
</Info>

## PrimerWebRedirectState

```swift theme={"dark"}
public struct PrimerWebRedirectState: Equatable {
  public enum Status: Equatable {
    case idle
    case loading
    case redirecting
    case polling
    case success
    case failure(String)
  }

  var status: Status
  var paymentMethod: CheckoutPaymentMethod?
  var surchargeAmount: String?
}
```

### Flow

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

| Property          | Type                     | Description                |
| ----------------- | ------------------------ | -------------------------- |
| `status`          | `Status`                 | Current payment status     |
| `paymentMethod`   | `CheckoutPaymentMethod?` | Payment method details     |
| `surchargeAmount` | `String?`                | Formatted surcharge amount |

## Payment methods

| Payment Method | Type String |
| -------------- | ----------- |
| Twint          | `"TWINT"`   |

<Note>
  Web redirect APMs share the same scope type. Use the `paymentMethodType` property to identify which payment method is active.
</Note>

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