STPCustomer
public class STPCustomer : NSObject
extension STPCustomer: STPAPIResponseDecodable
An STPCustomer
represents a deserialized Customer object from the Stripe API.
You shouldn’t need to instantiate an STPCustomer
– you should instead use
STPCustomerContext
to manage retrieving and updating a customer.
-
The Stripe ID of the customer, e.g.
cus_1234
Declaration
Swift
@objc public let stripeID: String
-
The default source used to charge the customer.
Declaration
Swift
@objc public private(set) var defaultSource: STPSourceProtocol? { get }
-
The available payment sources the customer has (this may be an empty array).
Declaration
Swift
@objc public private(set) var sources: [STPSourceProtocol] { get }
-
The customer’s shipping address.
Declaration
Swift
@objc public var shippingAddress: STPAddress?
-
Declaration
Swift
@objc public let allResponseFields: [AnyHashable : Any]
-
Initialize a customer object with the provided values.
Declaration
Swift
@objc public convenience init( stripeID: String, defaultSource: STPSourceProtocol?, sources: [STPSourceProtocol] )
Parameters
stripeID
The ID of the customer, e.g.
cus_abc
defaultSource
The default source of the customer, such as an
STPCard
object. Can be nil.sources
All of the customer’s payment sources. This might be an empty array.
Return Value
an instance of STPCustomer
-
Replaces the customer’s
sources
anddefaultSource
based on whether or not they should include Apple Pay sources. More details on documentation forSTPCustomerContext includeApplePaySources
@param filteringApplePay If YES, Apple Pay sources will be ignored
Declaration
Swift
@objc(updateSourcesFilteringApplePay:) public func updateSources(filteringApplePay: Bool)
-
Declaration
Swift
@objc public class func decodedObject(fromAPIResponse response: [AnyHashable : Any]?) -> `Self`?