Scope hierarchy
All scopes
| Scope | Purpose | State type |
|---|---|---|
PrimerCheckoutScope | Top-level checkout management | PrimerCheckoutState |
PrimerPaymentMethodSelectionScope | Payment method list and selection | PrimerPaymentMethodSelectionState |
PrimerCardFormScope | Card form fields and validation | PrimerCardFormState |
PrimerApplePayScope | Apple Pay button and availability | PrimerApplePayState |
PrimerPayPalScope | PayPal payment flow | PrimerPayPalState |
PrimerKlarnaScope | Klarna multi-step flow | PrimerKlarnaState |
PrimerAchScope | ACH multi-step flow | PrimerAchState |
PrimerWebRedirectScope | Web redirect payment flow (e.g., Twint) | PrimerWebRedirectState |
PrimerFormRedirectScope | Form-based redirect flow (e.g., BLIK, MBWay) | PrimerFormRedirectState |
PrimerQRCodeScope | QR code display and polling (e.g., PromptPay) | PrimerQRCodeState |
PrimerSelectCountryScope | Country picker (accessed via PrimerCardFormScope.selectCountry) | PrimerSelectCountryState |
Accessing scopes
Via the scope closure
Thescope parameter on PrimerCheckout provides access to the PrimerCheckoutScope:
Getting payment method scopes
UsegetPaymentMethodScope with a type parameter:
Type aliases
Scopes use type aliases for customization closures:| Alias | Signature | Used by |
|---|---|---|
Component | () -> any View | splashScreen, loadingScreen, cardInputSection |
ContainerComponent | (@escaping () -> any View) -> any View | container |
ErrorComponent | (String) -> any View | errorScreen |
PaymentMethodItemComponent | (CheckoutPaymentMethod) -> any View | paymentMethodItem |
CountryItemComponent | (PrimerCountry, @escaping () -> Void) -> any View | countryItem |
CategoryHeaderComponent | (String) -> any View | categoryHeader |
CardFormScreenComponent | (any PrimerCardFormScope) -> any View | Card form screen |
PaymentMethodSelectionScreenComponent | (PrimerPaymentMethodSelectionScope) -> any View | Selection screen |
WebRedirectScreenComponent | (any PrimerWebRedirectScope) -> any View | Web redirect screen |
WebRedirectButtonComponent | (any PrimerWebRedirectScope) -> any View | Web redirect payButton |
FormRedirectScreenComponent | (any PrimerFormRedirectScope) -> any View | Form redirect screen |
FormRedirectButtonComponent | (any PrimerFormRedirectScope) -> any View | Form redirect submitButton |
FormRedirectFormSectionComponent | (any PrimerFormRedirectScope) -> any View | Form redirect formSection |
QRCodeScreenComponent | (any PrimerQRCodeScope) -> any View | QR code screen |
Base protocol
All payment method scopes conform toPrimerPaymentMethodScope:
See also
State and events
Observe state changes for each scope
Layout customization
Customize UI using scope properties
PrimerCheckoutScope API
Full API reference