STPAddress
public class STPAddress : NSObject
extension STPAddress: STPAPIResponseDecodable
extension STPAddress: STPFormEncodable
extension STPAddress: NSCopying
STPAddress Contains an address as represented by the Stripe API.
-
The user’s full name (e.g. “Jane Doe”)
Declaration
Swift
@objc public var name: String?
-
The first line of the user’s street address (e.g. “123 Fake St”)
Declaration
Swift
@objc public var line1: String?
-
The apartment, floor number, etc of the user’s street address (e.g. “Apartment 1A”)
Declaration
Swift
@objc public var line2: String?
-
The city in which the user resides (e.g. “San Francisco”)
Declaration
Swift
@objc public var city: String?
-
The state in which the user resides (e.g. “CA”)
Declaration
Swift
@objc public var state: String?
-
The postal code in which the user resides (e.g. “90210”)
Declaration
Swift
@objc public var postalCode: String?
-
The ISO country code of the address (e.g. “US”)
Declaration
Swift
@objc public var country: String?
-
The phone number of the address (e.g. “8885551212”)
Declaration
Swift
@objc public var phone: String?
-
The email of the address (e.g. “jane@doe.com”)
Declaration
Swift
@objc public var email: String?
-
Declaration
Swift
@objc public var additionalAPIParameters: [AnyHashable : Any]
-
When creating a charge on your backend, you can attach shipping information to prevent fraud on a physical good. You can use this method to turn your user’s shipping address and selected shipping method into a hash suitable for attaching to a charge. You should pass this to your backend, and use it as the
shipping
parameter when creating a charge.Declaration
Swift
@objc(shippingInfoForChargeWithAddress:shippingMethod:) public class func shippingInfoForCharge( with address: STPAddress?, shippingMethod method: PKShippingMethod? ) -> [AnyHashable: Any]?
Parameters
address
The user’s shipping address. If nil, this method will return nil.
method
The user’s selected shipping method. May be nil.
-
Initializes an empty STPAddress.
Declaration
Swift
@objc public override init()
-
Initializes a new STPAddress with data from STPPaymentMethodBillingDetails.
Declaration
Swift
@objc public init(paymentMethodBillingDetails billingDetails: STPPaymentMethodBillingDetails)
Parameters
billingDetails
The STPPaymentMethodBillingDetails instance you want to populate the STPAddress from.
Return Value
A new STPAddress instance with data copied from the passed in billing details.
-
Initializes a new STPAddress with data from an PassKit contact.
Declaration
Swift
@objc(initWithPKContact:) public init(pkContact contact: PKContact)
Parameters
contact
The PassKit contact you want to populate the STPAddress from.
Return Value
A new STPAddress instance with data copied from the passed in contact.
-
Generates a PassKit contact representation of this STPAddress.
Declaration
Swift
@objc(PKContactValue) public func pkContactValue() -> PKContact
Return Value
A new PassKit contact with data copied from this STPAddress instance.
-
Initializes a new STPAddress with a contact from the Contacts framework.
Declaration
Swift
@objc(initWithCNContact:) public init(cnContact contact: CNContact)
Parameters
contact
The CNContact you want to populate the STPAddress from.
Return Value
A new STPAddress instance with data copied from the passed in contact.
-
Declaration
Swift
@objc public private(set) var allResponseFields: [AnyHashable : Any] { get }
-
Declaration
Swift
@objc public class func decodedObject(fromAPIResponse response: [AnyHashable : Any]?) -> `Self`?
-
Declaration
Swift
@objc public class func rootObjectName() -> String?
-
Declaration
Swift
@objc public class func propertyNamesToFormFieldNamesMapping() -> [String : String]