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

Declaration

@MainActor
public protocol PrimerWebRedirectScope: PrimerPaymentMethodScope where State == PrimerWebRedirectState

Properties

PropertyTypeDescription
paymentMethodTypeStringPayment method type identifier (e.g., "TWINT")
stateAsyncStream<PrimerWebRedirectState>Stream of web redirect state changes

Customization

PropertyTypeDescription
screenWebRedirectScreenComponent?Full screen replacement. Signature: (any PrimerWebRedirectScope) -> any View
payButtonWebRedirectButtonComponent?Custom pay button. Signature: (any PrimerWebRedirectScope) -> any View
submitButtonTextString?Submit button label
This scope inherits start(), submit(), cancel(), onBack(), presentationContext, and dismissalMechanism from PrimerPaymentMethodScope.

PrimerWebRedirectState

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

PropertyTypeDescription
statusStatusCurrent payment status
paymentMethodCheckoutPaymentMethod?Payment method details
surchargeAmountString?Formatted surcharge amount

Payment methods

Payment MethodType String
Twint"TWINT"
Web redirect APMs share the same scope type. Use the paymentMethodType property to identify which payment method is active.

See also

Scopes overview

All available scopes