Actionable
Last updated: September 2, 2026
A type alias for a component, which is:
Describable– It 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/// A Boolean value indicating whether to show the pay button for the component's current step.6var isPayButtonRequired: Bool { get }78/// Call to start the current payment process9func submit()10}
1protocol Tokenizable: Sendable {2/// The value the asynchronous `tokenize()` returns.3///4/// Payment components use `Void` and report their token through the5/// `onTokenized` callback. The CVV component uses6/// `Result<CvvTokenResponse, CheckoutComponents.Error>?` and returns the7/// token directly.8associatedtype TokenizedType910/// A Boolean value indicating whether the component validation is passed.11var isValid: Bool { get }1213/// Tokenizes the component's input and returns the result.14@discardableResult15func tokenize() async -> TokenizedType1617/// Tokenizes the component's input. The result is delivered through the18/// `onTokenized` callback rather than returned.19func tokenize()20}
Components report their token in one of two ways, depending on whether they submit to Checkout.com:
- Payment components, such as the card component, deliver their token through the
onTokenizedcallback. Their asynchronoustokenize()returnsVoid. - The CVV component has no payment session to submit to, so its asynchronous
tokenize()returns the token directly, asResult<CvvTokenResponse, CheckoutComponents.Error>?.
Renders 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.
For payment components, use the onTokenized() callback to retrieve the generated token and process the token details as required.
1component.tokenize()
For the sessionless CVV component, call the asynchronous overload instead. It returns the token directly, rather than through a callback:
1switch await cvv.tokenize() {2case .success(let response):3print(response.token)4case .failure(let error):5print(error.errorCode)6case .none:7break8}
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
Indicates whether to show the pay button for the component's current step. Defaults to true.
It returns false during intermediate steps of multi-step payment methods. For example, when stc pay requests the customer's phone number.
1component.isPayButtonRequired