FlowController
@available(iOSApplicationExtension, unavailable)
@available(macCatalystApplicationExtension, unavailable)
public class FlowController
A class that presents the individual steps of a payment flow
-
Contains details about a payment method that can be displayed to the customer
See moreDeclaration
Swift
public struct PaymentOptionDisplayData
-
This contains all configurable properties of PaymentSheet
Declaration
Swift
public let configuration: Configuration
-
Contains information about the customer’s desired payment option. You can use this to e.g. display the payment option in your UI.
Declaration
Swift
public var paymentOption: PaymentOptionDisplayData? { get }
-
Presents a sheet where the customer chooses how to pay, either by selecting an existing payment method or adding a new one Call this when your “Select a payment method” button is tapped
Declaration
Swift
public func presentPaymentOptions( from presentingViewController: UIViewController, completion: (() -> ())? = nil )
-
Completes the payment or setup.
Declaration
Swift
public func confirm( from presentingViewController: UIViewController, completion: @escaping (PaymentSheetResult) -> () )
Parameters
presentingViewController
The view controller used to present any view controllers required e.g. to authenticate the customer
completion
Called with the result of the payment after any presented view controllers are dismissed
-
A button which presents a sheet for a customer to select a payment method. This is a convenience wrapper for the .paymentOptionsSheet() ViewModifier.
See moreDeclaration
Swift
public struct PaymentOptionsButton<Content> : View where Content : View
Parameters
paymentSheetFlowController
A PaymentSheet.FlowController to present.
onSheetDismissed
Called after the payment method selector is dismissed.
content
The content of the view.
-
A button which confirms the payment. Depending on the user’s payment method, it may present a confirmation sheet. This is a convenience wrapper for the .paymentConfirmationSheet() ViewModifier.
See moreDeclaration
Swift
public struct ConfirmPaymentButton<Content> : View where Content : View
Parameters
paymentSheetFlowController
A PaymentSheet.FlowController to present.
onCompletion
Called with the result of the payment after the payment confirmation is done and the PaymentSheet (if any) is dismissed.
content
The content of the view.