Customer

@objcMembers
public final class Customer : NSObject, Decodable, OptionallyIdentifiableWithString

Customer model.

  • Customer identifier (if you know it).

    Declaration

    Swift

    public var identifier: String?
  • Customer’s email address.

    Declaration

    Swift

    public var emailAddress: EmailAddress?
  • Customer’s phone number.

    Declaration

    Swift

    public var phoneNumber: PhoneNumber?
  • Customer’s first name.

    Declaration

    Swift

    public var firstName: String?
  • Customer’s middle name.

    Declaration

    Swift

    public var middleName: String?
  • Customer’s last name.

    Declaration

    Swift

    public var lastName: String?
  • An arbitrary string attached to the object. Often useful for displaying to users.

    Declaration

    Swift

    public var descriptionText: String?
  • Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the object in a structured format.

    Declaration

    Swift

    public var metadata: Metadata?
  • Customer title.

    Declaration

    Swift

    public var title: String?
  • Customer’s nationality.

    Declaration

    Swift

    public var nationality: String?
  • Currency in which customer can be charged.

    Declaration

    Swift

    public var currency: Currency?
  • Initializes the customer with email address, phone number and a name.

    Throws

    Invalid customer info error.

    Declaration

    Swift

    public convenience init(emailAddress: EmailAddress, phoneNumber: PhoneNumber, name: String) throws

    Parameters

    emailAddress

    Email address.

    phoneNumber

    Phone number.

    name

    Name.

  • Initializes the customer with email address, phone number, first name, middle name and last name.

    Throws

    Invalid customer info error.

    Declaration

    Swift

    public convenience init(emailAddress: EmailAddress, phoneNumber: PhoneNumber, firstName: String, middleName: String?, lastName: String?) throws

    Parameters

    emailAddress

    Email address.

    phoneNumber

    Phone number.

    firstName

    First name.

    middleName

    Middle name.

    lastName

    Last name.

  • Initializes the customer with the customer identifier.

    Throws

    Invalid customer info error.

    Declaration

    Swift

    public convenience init(identifier: String) throws

    Parameters

    identifier

    Customer identifier.

  • Checks if the receiver is equal to object.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

    Parameters

    object

    Object to test equality with.

    Return Value

    true if the receiver is equal to object, false otherwise.

  • Checks if 2 objects are equal.

    Declaration

    Swift

    public static func == (lhs: Customer, rhs: Customer) -> Bool

    Parameters

    lhs

    First object.

    rhs

    Second object.

    Return Value

    true if 2 objects are equal, fale otherwise.

  • Copies the receiver.

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    Zone.

    Return Value

    Copy of the receiver.

  • Encodes the contents of the receiver.

    Throws

    EncodingError

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    Encoder.