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

  • Deletes all persisted authentication state associated with a customer.

    You must call this method when the user logs out from your app. This will ensure that any persisted authentication state in PaymentSheet, such as authentication cookies, is also cleared during logout.

    Warning

    Deprecated. Use PaymentSheet.resetCustomer() instead.

    Declaration

    Swift

    @available(*, deprecated, renamed: "resetCustomer(﹚")
    public static func reset()
  • Deletes all persisted authentication state associated with a customer.

    You must call this method when the user logs out from your app. This will ensure that any persisted authentication state in PaymentSheet, such as authentication cookies, is also cleared during logout.

    Declaration

    Swift

    public static func resetCustomer()

Configuration