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.
-
Confirm the payment, presenting a sheet for the user to confirm their payment if needed.
Declaration
Swift
public func paymentConfirmationSheet( isConfirmingPayment: Binding<Bool>, paymentIntentParams: STPPaymentIntentParams, onCompletion: @escaping STPPaymentHandlerActionPaymentIntentCompletionBlock ) -> some View
Parameters
isConfirmingPayment
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.paymentIntentParams
A PaymentIntentParams to confirm.
onCompletion
Called with the result of the payment after the payment confirmation is done and the sheet (if any) is dismissed.
-
Confirm the SetupIntent, presenting a sheet for the user to confirm if needed.
Declaration
Swift
public func setupIntentConfirmationSheet( isConfirmingSetupIntent: Binding<Bool>, setupIntentParams: STPSetupIntentConfirmParams, onCompletion: @escaping STPPaymentHandlerActionSetupIntentCompletionBlock ) -> some View
Parameters
isConfirmingSetupIntent
A binding to whether the SetupIntent is being confirmed. This will present a sheet if needed. It will be updated to
false
after performing the SetupIntent confirmation.paymentIntentParams
A SetupIntentParams to confirm.
onCompletion
Called with the result of the SetupIntent confirmation after the confirmation is done and the sheet (if any) is dismissed.