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

# PrimerApplePayScope

> API reference for the Apple Pay scope

`PrimerApplePayScope` manages Apple Pay availability, button display, and payment initiation.

## Declaration

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

## Properties

| Property | Type                               | Description                                                                       |
| -------- | ---------------------------------- | --------------------------------------------------------------------------------- |
| `state`  | `AsyncStream<PrimerApplePayState>` | Stream of Apple Pay state changes. Use `state.isAvailable` to check availability. |

### Customization

| Property         | Type                                       | Description             |
| ---------------- | ------------------------------------------ | ----------------------- |
| `screen`         | `((any PrimerApplePayScope) -> any View)?` | Full screen replacement |
| `applePayButton` | `((@escaping () -> Void) -> any View)?`    | Custom Apple Pay button |

## Methods

| Method                          | Description                                     |
| ------------------------------- | ----------------------------------------------- |
| `submit()`                      | Initiate Apple Pay payment                      |
| `PrimerApplePayButton(action:)` | Returns the SDK's Apple Pay button as `AnyView` |

## PrimerApplePayState

```swift theme={"dark"}
public struct PrimerApplePayState: Equatable {
  var isLoading: Bool
  var isAvailable: Bool
  var availabilityError: String?
  var buttonStyle: PKPaymentButtonStyle
  var buttonType: PKPaymentButtonType
  var cornerRadius: CGFloat
}
```

| Property            | Type                   | Description                               |
| ------------------- | ---------------------- | ----------------------------------------- |
| `isLoading`         | `Bool`                 | Loading state                             |
| `isAvailable`       | `Bool`                 | Device supports Apple Pay                 |
| `availabilityError` | `String?`              | Reason if unavailable                     |
| `buttonStyle`       | `PKPaymentButtonStyle` | Current button style                      |
| `buttonType`        | `PKPaymentButtonType`  | Current button type (buy, checkout, etc.) |
| `cornerRadius`      | `CGFloat`              | Button corner radius                      |

## See also

<CardGroup cols={2}>
  <Card title="Apple Pay integration" icon="apple" href="/sdk/ios-checkout/v3.0.0-beta/guides-and-recipes/apple-pay-integration">
    Apple Pay integration guide
  </Card>
</CardGroup>
