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. UsePaymentSheet.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 for PaymentSheet
See moreDeclaration
Swift
public struct Configuration
-
A button which presents a sheet for a customer to complete their payment. This is a convenience wrapper for the .paymentSheet() ViewModifier.
See moreDeclaration
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 moreDeclaration
Swift
@available(iOSApplicationExtension, unavailable) @available(macCatalystApplicationExtension, unavailable) public class FlowController
-
Describes the appearance of PaymentSheet
See moreDeclaration
Swift
struct Appearance : Equatable
-
Style options for colors in PaymentSheet
See moreDeclaration
Swift
@available(iOS 13.0, *) public enum UserInterfaceStyle : Int
-
Options for the default state of save payment method controls @note Some jurisdictions may have rules governing the ability to default to opt-out behaviors
See moreDeclaration
Swift
public enum SavePaymentMethodOptInBehavior
-
Configuration related to the Stripe Customer
See moreDeclaration
Swift
public struct CustomerConfiguration
-
Configuration related to Apple Pay
See moreDeclaration
Swift
public struct ApplePayConfiguration
-
An address.
See moreDeclaration
Swift
public struct Address : Equatable
-
Billing details of a customer
See moreDeclaration
Swift
public struct BillingDetails : Equatable