PaymentSheet

public class PaymentSheet

A drop-in class that presents a sheet for a customer to complete their payment

  • This contains all configurable properties of PaymentSheet

    Declaration

    Swift

    public let configuration: Configuration
  • The most recent error encountered by the customer, if any.

    Declaration

    Swift

    public private(set) var mostRecentError: Error? { get }
  • Initializes a PaymentSheet

    Note

    This can be used to complete a payment - don’t log it, store it, or expose it to anyone other than the customer.

    Declaration

    Swift

    public convenience init(paymentIntentClientSecret: String, configuration: Configuration)

    Parameters

    paymentIntentClientSecret

    The client secret of a Stripe PaymentIntent object

    configuration

    Configuration for the PaymentSheet. e.g. your business name, Customer details, etc.

  • Initializes a PaymentSheet

    Declaration

    Swift

    public convenience init(setupIntentClientSecret: String, configuration: Configuration)

    Parameters

    setupIntentClientSecret

    The client secret of a Stripe SetupIntent object

    configuration

    Configuration for the PaymentSheet. e.g. your business name, Customer details, etc.

  • Presents a sheet for a customer to complete their payment

    Declaration

    Swift

    @available(iOSApplicationExtension, unavailable)
    @available(macCatalystApplicationExtension, unavailable)
    public func present(
        from presentingViewController: UIViewController,
        completion: @escaping (PaymentSheetResult) -> ()
    )

    Parameters

    presentingViewController

    The view controller to present a payment sheet

    completion

    Called with the result of the payment after the payment sheet is dismissed

  • A button which presents a sheet for a customer to complete their payment. This is a convenience wrapper for the .paymentSheet() ViewModifier.

    See more

    Declaration

    Swift

    public struct PaymentButton<Content> : View where Content : View

    Parameters

    paymentSheet

    A PaymentSheet to present.

    onCompletion

    Called with the result of the payment after the payment sheet is dismissed.

    content

    The content of the view.

  • A class that presents the individual steps of a payment flow

    See more

    Declaration

    Swift

    @available(iOSApplicationExtension, unavailable)
    @available(macCatalystApplicationExtension, unavailable)
    public class FlowController

Configuration