View
extension View
-
Presents a sheet for a customer to complete their payment.
Declaration
Swift
public func paymentSheet( isPresented: Binding<Bool>, paymentSheet: PaymentSheet, onCompletion: @escaping (PaymentSheetResult) -> Void ) -> some View
Parameters
isPresented
A binding to whether the sheet is presented.
paymentSheet
A PaymentSheet to present.
onCompletion
Called with the result of the payment after the payment sheet is dismissed.
-
Presents a sheet for a customer to select a payment option.
Declaration
Swift
public func paymentOptionsSheet( isPresented: Binding<Bool>, paymentSheetFlowController: PaymentSheet.FlowController, onSheetDismissed: (() -> Void)? ) -> some View
Parameters
isPresented
A binding to whether the sheet is presented.
paymentSheetFlowController
A PaymentSheet.FlowController to present.
onSheetDismissed
Called after the payment options sheet is dismissed.
-
Confirm the payment, presenting a sheet for the user to confirm their payment if needed.
Declaration
Swift
public func paymentConfirmationSheet( isConfirming: Binding<Bool>, paymentSheetFlowController: PaymentSheet.FlowController, onCompletion: @escaping (PaymentSheetResult) -> Void ) -> some View
Parameters
isConfirming
A binding to whether the payment is being confirmed. This will present a sheet if needed. It will be updated to
false
after performing the payment confirmation.paymentSheetFlowController
A PaymentSheet.FlowController to present.
onCompletion
Called with the result of the payment after the payment confirmation is done and the sheet (if any) is dismissed.