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
Property Type Description paymentMethodTypeStringPayment method type identifier (e.g., "TWINT") stateAsyncStream<PrimerWebRedirectState>Stream of web redirect state changes
Customization
Property Type Description 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
Property Type Description statusStatusCurrent payment status paymentMethodCheckoutPaymentMethod?Payment method details surchargeAmountString?Formatted surcharge amount
Payment methods
Payment Method Type 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