Actionable
Last updated: May 21, 2025
A type alias for a component that is:
Describable– Represents the component's name.Renderable– The component is ready to be rendered.Submittable– The component is ready to be submitted.Tokenizable– The component is ready to be tokenized.
1public typealias Actionable = Describable & Renderable & Tokenizable & Submittable
1protocol Describable: Sendable {2/// The name of the component.3var name: String { get }4}
1protocol Renderable: Sendable {2/// A Boolean value indicating whether the component is available.3var isAvailable: Bool { get }45/**6Renders a view representing the component.78- Returns: A view representing the component.9*/10@MainActor11func render() -> AnyView12}
1protocol Submittable: Sendable {2/// A Boolean value indicating whether the component validation is passed.3var isValid: Bool { get }45/// Call to start the current payment process6func submit()7}
1protocol Tokenizable {2/// Tokenizes the component's input3///4/// ## Discussion5/// This method handles tokenization of the component's data.6/// The tokenization result will be delivered through a callback closure.7func tokenize()8}
Render the component in a SwiftUI view
1if component.isAvailable {2component.render()3}
Submits a Submittable component, if you require your own pay button.
Information
You cannot call this method for digital wallet payment methods such as Apple Pay or Google Pay. If you do, it triggers an onError callback.
1component.submit()
Tokenizes the selected component, if supported.
Use onTokenized() callback to retrieve the generated token and process the token details as required.
1component.tokenize()
Checks if the Submittable component is ready to be submitted. The component is ready if it has:
- Captured all of the required details from the customer
- Passed validation
1component.isValid