Protocols
The following protocols are available globally.
-
Objects conforming to STPAPIResponseDecodable can be automatically converted from a JSON dictionary that was returned from the Stripe API.
See moreDeclaration
Swift
@objc public protocol STPAPIResponseDecodable : NSObjectProtocol
-
STPAUBECSDebitFormViewDelegate provides methods for STPAUBECSDebitFormView to inform its delegate of when the form has been completed.
See moreDeclaration
Swift
@objc public protocol STPAUBECSDebitFormViewDelegate : NSObjectProtocol
-
An
See moreSTPAddCardViewControllerDelegate
is notified when anSTPAddCardViewController
successfully creates a card token or is cancelled. It has internal error-handling logic, so there’s no error case to deal with.Declaration
Swift
@objc public protocol STPAddCardViewControllerDelegate : NSObjectProtocol
-
Implement the required methods of this delegate to supply a PaymentIntent to STPApplePayContext and be notified of the completion of the Apple Pay payment. You may also implement the optional delegate methods to handle shipping methods and shipping address changes e.g. to verify you can ship to the address, or update the payment amount.
See moreDeclaration
Swift
@available(iOSApplicationExtension, unavailable) @available(macCatalystApplicationExtension, unavailable) @objc public protocol STPApplePayContextDelegate : NSObjectProtocol
-
See moreSTPAuthenticationContext
provides information required to present authentication challenges to a user.Declaration
Swift
@objc public protocol STPAuthenticationContext : NSObjectProtocol
-
A “bridge” from our pre-built UI (
STPPaymentContext
,STPPaymentOptionsViewController
) to your backend to fetch Customer-related information needed to power those views. Typically, you will not need to implement this protocol yourself. You should instead useSTPCustomerContext
, which implementsand manages retrieving and updating a Stripe customer for you. Seealso
STPCustomerContext.h If you would prefer retrieving and updating your Stripe customer object via your own backend instead of usingSTPCustomerContext
, you should make your application’s API client conform to this interface.Declaration
Swift
@objc public protocol STPBackendAPIAdapter : NSObjectProtocol
-
An
See moreSTPBankSelectionViewControllerDelegate
is notified when a user selects a bank.Declaration
Swift
@objc public protocol STPBankSelectionViewControllerDelegate : NSObjectProtocol
-
See moreSTPCardFormViewDelegate
defines the interface that should be adopted to receive updates fromSTPCardFormView
instances.Declaration
Swift
@objc public protocol STPCardFormViewDelegate : NSObjectProtocol
-
You should make your application’s API client conform to this interface. It provides a way for Stripe utility classes to request a new ephemeral key from your backend, which it will use to retrieve and update Stripe API objects.
See moreDeclaration
Swift
@objc public protocol STPCustomerEphemeralKeyProvider : NSObjectProtocol
-
You should make your application’s API client conform to this interface. It provides a way for Stripe utility classes to request a new ephemeral key from your backend, which it will use to retrieve and update Stripe API objects.
See moreDeclaration
Swift
@objc public protocol STPIssuingCardEphemeralKeyProvider : NSObjectProtocol
-
You should make your application’s API client conform to this interface. It provides a way for Stripe utility classes to request a new ephemeral key from your backend, which it will use to retrieve and update Stripe API objects. @deprecated use
STPCustomerEphemeralKeyProvider
orSTPIssuingCardEphemeralKeyProvider
depending on the type of key that will@objc be fetched.Declaration
Swift
@available(*, deprecated, message: "use `STPCustomerEphemeralKeyProvider` or `STPIssuingCardEphemeralKeyProvider` depending on the type of key that will be fetched.") @objc public protocol STPEphemeralKeyProvider : STPCustomerEphemeralKeyProvider
-
Objects conforming to STPFormEncodable can be automatically converted to a form-encoded string, which can then be used when making requests to the Stripe API.
See moreDeclaration
Swift
@objc public protocol STPFormEncodable : NSObjectProtocol
-
STPFormTextFieldContainer is a protocol that views can conform to to provide customization properties for the field form views that they contain.
See moreDeclaration
Swift
@objc public protocol STPFormTextFieldContainer : NSObjectProtocol
-
This protocol allows a delegate to be notified when a payment text field’s contents change, which can in turn be used to take further actions depending on the validity of its contents.
See moreDeclaration
Swift
@objc public protocol STPPaymentCardTextFieldDelegate : NSObjectProtocol
-
Implement
See moreSTPPaymentContextDelegate
to get notified when a payment context changes, finishes, encounters errors, etc. In practice, if your app has a “checkout screen view controller”, that is a good candidate to implement this protocol.Declaration
Swift
@objc public protocol STPPaymentContextDelegate : NSObjectProtocol
-
This protocol represents a payment method that a user can select and use to pay. The classes that conform to it and are supported by the UI:
STPApplePay
, which represents that the user wants to pay with Apple PaySTPPaymentMethod
. OnlySTPPaymentMethod.type == STPPaymentMethodTypeCard
andSTPPaymentMethod.type == STPPaymentMethodTypeFPX
are supported bySTPPaymentContext
andSTPPaymentOptionsViewController
STPPaymentMethodParams
. This should be used with non-reusable payment method, such as FPX and iDEAL. Instead of reaching out to Stripe to create a PaymentMethod, you can pass an STPPaymentMethodParams directly to Stripe when confirming a PaymentIntent. @note card-based Sources, Cards, and FPX support this protocol for use in a custom integration.
Declaration
Swift
@objc public protocol STPPaymentOption : NSObjectProtocol
-
An
See moreSTPPaymentOptionsViewControllerDelegate
responds when a user selects a payment option from (or cancels) anSTPPaymentOptionsViewController
. In both of these instances, you should dismiss the view controller (either by popping it off the navigation stack, or dismissing it).Declaration
Swift
@objc public protocol STPPaymentOptionsViewControllerDelegate : NSObjectProtocol
-
An
See moreSTPShippingAddressViewControllerDelegate
is notified when anSTPShippingAddressViewController
receives an address, completes with an address, or is cancelled.Declaration
Swift
@objc public protocol STPShippingAddressViewControllerDelegate : NSObjectProtocol
-
Objects conforming to this protocol can be attached to a Stripe Customer object as a payment source.
See moreDeclaration
Swift
@objc public protocol STPSourceProtocol : NSObjectProtocol