Classes
The following classes are available globally.
-
A client for making connections to the Stripe API.
See moreDeclaration
Objective-C
@interface STPAPIClient : NSObject
Swift
class STPAPIClient : NSObject
-
A top-level class that imports the rest of the Stripe SDK.
See moreDeclaration
Objective-C
@interface Stripe : NSObject
Swift
class Stripe : NSObject
-
This view controller contains a credit card entry form that the user can fill out. On submission, it will use the Stripe API to convert the user’s card details to a Stripe token. It renders a right bar button item that submits the form, so it must be shown inside a
See moreUINavigationController
.Declaration
Objective-C
@interface STPAddCardViewController : STPCoreTableViewController
Swift
class STPAddCardViewController : STPCoreTableViewController
-
STPAddress Contains an address as represented by the Stripe API.
See moreDeclaration
Objective-C
@interface STPAddress : NSObject <STPAPIResponseDecodable, STPFormEncodable, NSCopying>
Swift
class STPAddress : NSObject, STPAPIResponseDecodable, STPFormEncodable, NSCopying
-
An empty class representing that the user wishes to pay via Apple Pay. This can be checked on an
STPPaymentContext
, e.g:if ([paymentContext.selectedPaymentOption isKindOfClass:[STPApplePay class]]) { // Don't ask the user for their card number; they want to pay with apple pay. }
Declaration
Objective-C
@interface STPApplePayPaymentOption : NSObject <STPPaymentOption>
Swift
class STPApplePayPaymentOption : NSObject, STPPaymentOption
-
Representation of a user’s bank account details that have been tokenized with the Stripe API.
See moreDeclaration
Objective-C
@interface STPBankAccount : NSObject <STPAPIResponseDecodable, STPSourceProtocol>
Swift
class STPBankAccount : NSObject, STPAPIResponseDecodable, STPSourceProtocol
-
Representation of a user’s bank account details. You can assemble these with information that your user enters and then create Stripe tokens with them using an STPAPIClient.
See moreDeclaration
Objective-C
@interface STPBankAccountParams : NSObject <STPFormEncodable>
Swift
class STPBankAccountParams : NSObject, STPFormEncodable
-
Representation of a user’s credit card details that have been tokenized with the Stripe API
See moreDeclaration
Objective-C
@interface STPCard : NSObject <STPAPIResponseDecodable, STPPaymentOption, STPSourceProtocol>
Swift
class STPCard : NSObject, STPAPIResponseDecodable, STPPaymentOption, STPSourceProtocol
-
Representation of a user’s credit card details. You can assemble these with information that your user enters and then create Stripe tokens with them using an STPAPIClient.
See moreDeclaration
Objective-C
@interface STPCardParams : NSObject <STPFormEncodable, NSCopying>
Swift
class STPCardParams : NSObject, STPFormEncodable, NSCopying
-
This class contains static methods to validate card numbers, expiration dates, and CVCs. For a list of test card numbers to use with this code, see https://stripe.com/docs/testing
See moreDeclaration
Objective-C
@interface STPCardValidator : NSObject
Swift
class STPCardValidator : NSObject
-
Parameters for creating a Connect Account token.
See moreDeclaration
Objective-C
@interface STPConnectAccountParams : NSObject <STPFormEncodable>
Swift
class STPConnectAccountParams : NSObject, STPFormEncodable
-
This is the base class for all Stripe scroll view controllers. It is intended for use only by Stripe classes, you should not subclass it yourself in your app.
Declaration
Objective-C
@interface STPCoreScrollViewController : STPCoreViewController
Swift
class STPCoreScrollViewController : STPCoreViewController
-
This is the base class for all Stripe scroll view controllers. It is intended for use only by Stripe classes, you should not subclass it yourself in your app.
It inherits from STPCoreScrollViewController and changes the type of the created scroll view to UITableView, as well as other shared table view logic.
Declaration
Objective-C
@interface STPCoreTableViewController : STPCoreScrollViewController
Swift
class STPCoreTableViewController : STPCoreScrollViewController
-
This is the base class for all Stripe view controllers. It is intended for use only by Stripe classes, you should not subclass it yourself in your app.
It theming, back/cancel button management, and other shared logic for Stripe view controllers.
See moreDeclaration
Objective-C
@interface STPCoreViewController : UIViewController
Swift
class STPCoreViewController : UIViewController
-
An
See moreSTPCustomer
represents a deserialized Customer object from the Stripe API. You shouldn’t need to instantiate anSTPCustomer
– you should instead useSTPCustomerContext
to manage retrieving and updating a customer.Declaration
Objective-C
@interface STPCustomer : NSObject <STPAPIResponseDecodable>
Swift
class STPCustomer : NSObject, STPAPIResponseDecodable
-
Use
See moreSTPCustomerDeserializer
to convert a response from the Stripe API into anSTPCustomer
object.STPCustomerDeserializer
expects the JSON response to be in the exact same format as the Stripe API.Declaration
Objective-C
@interface STPCustomerDeserializer : NSObject
Swift
class STPCustomerDeserializer : NSObject
-
An
See moreSTPCustomerContext
retrieves and updates a Stripe customer using an ephemeral key, a short-lived API key scoped to a specific customer object. If your current user logs out of your app and a new user logs in, be sure to either create a new instance ofSTPCustomerContext
or clear the current instance’s cached customer. On your backend, be sure to create and return a new ephemeral key for the Customer object associated with the new user.Declaration
Objective-C
@interface STPCustomerContext : NSObject <STPBackendAPIAdapter>
Swift
class STPCustomerContext : NSObject, STPBackendAPIAdapter
-
Representation of a file upload object in the Stripe API.
See moreDeclaration
Objective-C
@interface STPFile : NSObject <STPAPIResponseDecodable>
Swift
class STPFile : NSObject, STPAPIResponseDecodable
-
This class lets you access card icons used by the Stripe SDK. All icons are 32 x 20 points.
See moreDeclaration
Objective-C
@interface STPImageLibrary : NSObject
Swift
class STPImageLibrary : NSObject
-
Stripe API parameters to define a Person. Things like their name, address, etc.
All of the fields are optional.
See moreDeclaration
Objective-C
@interface STPPersonParams : NSObject <STPFormEncodable>
Swift
class STPPersonParams : NSObject, STPFormEncodable
-
Stripe API parameters to define a Legal Entity. This extends
STPPersonParams
and adds some more fields.Legal entities can be either an individual or a company.
See moreDeclaration
Objective-C
@interface STPLegalEntityParams : STPPersonParams
Swift
class STPLegalEntityParams : STPPersonParams
-
Parameters for supported types of verification.
See moreDeclaration
Objective-C
@interface STPVerificationParams : NSObject <STPFormEncodable>
Swift
class STPVerificationParams : NSObject, STPFormEncodable
-
This class can be used wherever you’d use a
See moreUIActivityIndicatorView
and is intended to have a similar API. It renders as a spinning circle with a gap in it, similar to what you see in the App Store app or in the Apple Pay dialog when making a purchase. To change its color, set thetintColor
property.Declaration
Objective-C
@interface STPPaymentActivityIndicatorView : UIView
Swift
class STPPaymentActivityIndicatorView : UIView
-
STPPaymentCardTextField is a text field with similar properties to UITextField, but specialized for collecting credit/debit card information. It manages multiple UITextFields under the hood to collect this information. It’s designed to fit on a single line, and from a design perspective can be used anywhere a UITextField would be appropriate.
See moreDeclaration
Objective-C
@interface STPPaymentCardTextField : UIControl <UIKeyInput>
Swift
class STPPaymentCardTextField : UIControl, UIKeyInput
-
An
STPPaymentConfiguration
represents all the options you can set or change around a payment.You provide an
See moreSTPPaymentConfiguration
object to yourSTPPaymentContext
when making a charge. The configuration generally has settings that will not change from payment to payment and thus is reusable, while the context is specific to a single particular payment instance.Declaration
Objective-C
@interface STPPaymentConfiguration : NSObject <NSCopying>
Swift
class STPPaymentConfiguration : NSObject, NSCopying
-
An
STPPaymentContext
keeps track of all of the state around a payment. It will manage fetching a user’s saved payment methods, tracking any information they select, and prompting them for required additional information before completing their purchase. It can be used to power your application’s “payment confirmation” page with just a few lines of code.STPPaymentContext
also provides a unified interface to multiple payment methods - for example, you can write a single integration to accept both credit card payments and Apple Pay.
See moreSTPPaymentContext
saves information about a user’s payment methods to a Stripe customer object, and requires anSTPCustomerContext
to manage retrieving and modifying the customer.Declaration
Objective-C
@interface STPPaymentContext : NSObject
Swift
class STPPaymentContext : NSObject
-
A PaymentIntent tracks the process of collecting a payment from your customer.
See moreDeclaration
Objective-C
@interface STPPaymentIntent : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentIntent : NSObject, STPAPIResponseDecodable
-
Action details for an STPPaymentIntent. This is a container for the various types that are available. Check the
See moretype
to see which one it is, and then use the related property for the details necessary to handle it.Declaration
Objective-C
@interface STPPaymentIntentAction : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentIntentAction : NSObject, STPAPIResponseDecodable
-
Contains instructions for authenticating a payment by redirecting your customer to another page or application.
See moreDeclaration
Objective-C
@interface STPPaymentIntentActionRedirectToURL : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentIntentActionRedirectToURL : NSObject, STPAPIResponseDecodable
-
An object representing parameters used to confirm a PaymentIntent object.
A PaymentIntent must have a PaymentMethod or Source associated in order to successfully confirm it.
That PaymentMethod or Source can either be:
- created during confirmation, by passing in a
STPPaymentMethodParams
orSTPSourceParams
object in thepaymentMethodParams
orsourceParams
field - a pre-existing PaymentMethod or Source can be associated by passing its id in the
paymentMethodId
orsourceId
field or already set via your backend, either when creating or updating the PaymentIntent
Declaration
Objective-C
@interface STPPaymentIntentParams : NSObject <STPFormEncodable>
Swift
class STPPaymentIntentParams : NSObject, STPFormEncodable
- created during confirmation, by passing in a
-
PaymentMethod objects represent your customer’s payment instruments. They can be used with PaymentIntents to collect payments.
See moreDeclaration
Objective-C
@interface STPPaymentMethod : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethod : NSObject, STPAPIResponseDecodable
-
The billing address, a property on
See moreSTPPaymentMethodBillingDetails
Declaration
Objective-C
@interface STPPaymentMethodAddress : NSObject <STPAPIResponseDecodable, STPFormEncodable>
Swift
class STPPaymentMethodAddress : NSObject, STPAPIResponseDecodable, STPFormEncodable
-
Billing information associated with a
See moreSTPPaymentMethod
that may be used or required by particular types of payment methods.Declaration
Objective-C
@interface STPPaymentMethodBillingDetails : NSObject <STPAPIResponseDecodable, STPFormEncodable>
Swift
class STPPaymentMethodBillingDetails : NSObject, STPAPIResponseDecodable, STPFormEncodable
-
Contains details about a user’s credit card.
See moreDeclaration
Objective-C
@interface STPPaymentMethodCard : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCard : NSObject, STPAPIResponseDecodable
-
Checks on Card address and CVC.
See moreDeclaration
Objective-C
@interface STPPaymentMethodCardChecks : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCardChecks : NSObject, STPAPIResponseDecodable
-
The user’s card details.
See moreDeclaration
Objective-C
@interface STPPaymentMethodCardParams : NSObject <STPFormEncodable>
Swift
class STPPaymentMethodCardParams : NSObject, STPFormEncodable
-
Details about the Card Present payment method
Declaration
Objective-C
@interface STPPaymentMethodCardPresent : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCardPresent : NSObject, STPAPIResponseDecodable
-
A Card Wallet.
See moreDeclaration
Objective-C
@interface STPPaymentMethodCardWallet : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCardWallet : NSObject, STPAPIResponseDecodable
-
Declaration
Objective-C
@interface STPPaymentMethodCardWalletMasterpass : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCardWalletMasterpass : NSObject, STPAPIResponseDecodable
-
Declaration
Objective-C
@interface STPPaymentMethodCardWalletVisaCheckout : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodCardWalletVisaCheckout : NSObject, STPAPIResponseDecodable
-
An object representing parameters used to create a PaymentMethod object.
See moreDeclaration
Objective-C
@interface STPPaymentMethodParams : NSObject <STPFormEncodable>
Swift
class STPPaymentMethodParams : NSObject, STPFormEncodable
-
Contains details on how an
See moreSTPPaymentMethodCard
maybe be used for 3D Secure authentication.Declaration
Objective-C
@interface STPPaymentMethodThreeDSecureUsage : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodThreeDSecureUsage : NSObject, STPAPIResponseDecodable
-
An iDEAL Payment Method.
See moreDeclaration
Objective-C
@interface STPPaymentMethodiDEAL : NSObject <STPAPIResponseDecodable>
Swift
class STPPaymentMethodiDEAL : NSObject, STPAPIResponseDecodable
-
An object representing parameters used to create an iDEAL Payment Method
See moreDeclaration
Objective-C
@interface STPPaymentMethodiDEALParams : NSObject <STPFormEncodable>
Swift
class STPPaymentMethodiDEALParams : NSObject, STPFormEncodable
-
This view controller presents a list of payment method options to the user, which they can select between. They can also add credit cards to the list.
It must be displayed inside a
See moreUINavigationController
, so you can either create aUINavigationController
with anSTPPaymentOptionsViewController
as therootViewController
and then present theUINavigationController
, or push a newSTPPaymentOptionsViewController
onto an existingUINavigationController
‘s stack. You can also haveSTPPaymentContext
do this for you automatically, by callingpresentPaymentOptionsViewController
orpushPaymentOptionsViewController
on it.Declaration
Objective-C
@interface STPPaymentOptionsViewController : STPCoreViewController
Swift
class STPPaymentOptionsViewController : STPCoreViewController
-
When you’re using
See moreSTPPaymentContext
to request your user’s payment details, this is the object that will be returned to your application when they’ve successfully made a payment. It currently just contains asource
, but in the future will include any relevant metadata as well. You should passsource.stripeID
to your server, and call the charge creation endpoint. This assumes you are charging a Customer, so you should specify thecustomer
parameter to be that customer’s ID and thesource
parameter to the value returned here. For more information, see https://stripe.com/docs/api#create_chargeDeclaration
Objective-C
@interface STPPaymentResult : NSObject
Swift
class STPPaymentResult : NSObject
-
This is a helper class for handling redirects associated with STPSource and STPPaymentIntents.
Init and retain an instance with the Source or PaymentIntent you want to handle, then choose a redirect method. The context will fire the completion handler when the redirect completes.
Due to the nature of iOS, very little concrete information can be gained during this process, as all actions take place in either the Safari app or the sandboxed SFSafariViewController class. The context attempts to detect when the user has completed the necessary redirect action by listening for both app foregrounds and url callbacks received in the app delegate. However, it is possible the when the redirect is “completed”, the user may have not actually completed the necessary actions to authorize the charge.
You should not use either this class, nor
STPAPIClient
, as a way to determine when you should charge the Source or to determine if the redirect was successful. Use Stripe webhooks on your backend server to listen for Source state changes and to make the charge.Note
You must retain this instance for the duration of the redirect flow. This class dismisses any presented view controller upon deallocation.See https://stripe.com/docs/sources/best-practices
See moreDeclaration
Objective-C
@interface STPRedirectContext : NSObject
Swift
class STPRedirectContext : NSObject
-
This view controller contains a shipping address collection form. It renders a right bar button item that submits the form, so it must be shown inside a
See moreUINavigationController
. Depending on your configuration’s shippingType, the view controller may present a shipping method selection form after the user enters an address.Declaration
Objective-C
@interface STPShippingAddressViewController : STPCoreTableViewController
Swift
class STPShippingAddressViewController : STPCoreTableViewController
-
Representation of a customer’s payment instrument created with the Stripe API. - see: https://stripe.com/docs/api#sources
See moreDeclaration
Objective-C
@interface STPSource : NSObject <STPAPIResponseDecodable, STPSourceProtocol, STPPaymentOption>
Swift
class STPSource : NSObject, STPAPIResponseDecodable, STPSourceProtocol, STPPaymentOption
-
This class provides typed access to the contents of an STPSource
See moredetails
dictionary for card sources.Declaration
Objective-C
@interface STPSourceCardDetails : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceCardDetails : NSObject, STPAPIResponseDecodable
-
Information about a source’s owner.
See moreDeclaration
Objective-C
@interface STPSourceOwner : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceOwner : NSObject, STPAPIResponseDecodable
-
An object representing parameters used to create a Source object.
See moreDeclaration
Objective-C
@interface STPSourceParams : NSObject <STPFormEncodable, NSCopying>
Swift
class STPSourceParams : NSObject, STPFormEncodable, NSCopying
-
Information related to a source’s receiver flow.
See moreDeclaration
Objective-C
@interface STPSourceReceiver : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceReceiver : NSObject, STPAPIResponseDecodable
-
Information related to a source’s redirect flow.
See moreDeclaration
Objective-C
@interface STPSourceRedirect : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceRedirect : NSObject, STPAPIResponseDecodable
-
This class provides typed access to the contents of an STPSource
See moredetails
dictionary for SEPA Debit sources.Declaration
Objective-C
@interface STPSourceSEPADebitDetails : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceSEPADebitDetails : NSObject, STPAPIResponseDecodable
-
Information related to a source’s verification flow.
See moreDeclaration
Objective-C
@interface STPSourceVerification : NSObject <STPAPIResponseDecodable>
Swift
class STPSourceVerification : NSObject, STPAPIResponseDecodable
-
STPTheme objects can be used to visually style Stripe-provided UI. See https://stripe.com/docs/mobile/ios/standard#theming for more information.
See moreDeclaration
Objective-C
@interface STPTheme : NSObject <NSCopying>
Swift
class STPTheme : NSObject, NSCopying
-
A token returned from submitting payment details to the Stripe API. You should not have to instantiate one of these directly.
See moreDeclaration
Objective-C
@interface STPToken : NSObject <STPAPIResponseDecodable, STPSourceProtocol>
Swift
class STPToken : NSObject, STPAPIResponseDecodable, STPSourceProtocol
-
You can use this class to specify information that you’ve already collected from your user. You can then set the
See moreprefilledInformation
property onSTPPaymentContext
,STPAddCardViewController
, etc and it will pre-fill this information whenever possible.Declaration
Objective-C
@interface STPUserInformation : NSObject <NSCopying>
Swift
class STPUserInformation : NSObject, NSCopying