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

# PrimerPayPalScope

> API reference for the PayPal scope

`PrimerPayPalScope` manages the PayPal payment flow including redirect handling.

## Declaration

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

## Properties

| Property              | Type                             | Description                          |
| --------------------- | -------------------------------- | ------------------------------------ |
| `state`               | `AsyncStream<PrimerPayPalState>` | Stream of PayPal state changes       |
| `presentationContext` | `PresentationContext`            | `.direct` or `.fromPaymentSelection` |
| `dismissalMechanism`  | `[DismissalMechanism]`           | Supported dismissal methods          |

### Customization

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

## Methods

| Method     | Description            |
| ---------- | ---------------------- |
| `start()`  | Begin the PayPal flow  |
| `submit()` | Submit the payment     |
| `onBack()` | Navigate back          |
| `cancel()` | Cancel the PayPal flow |

## PrimerPayPalState

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

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

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

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