OPPBillingAddressBuilder

@interface OPPBillingAddressBuilder : NSObject

Builder class for costructing billing address object.

  • Set billing address country.

    Declaration

    Objective-C

    - (nonnull instancetype)withCountry:(nonnull NSString *)country;

    Swift

    func withCountry(_ country: String) -> Self

    Parameters

    country

    The country of the billing address.

    Return Value

    self.

  • Set billing address state.

    Declaration

    Objective-C

    - (nonnull instancetype)withState:(nonnull NSString *)state;

    Swift

    func withState(_ state: String) -> Self

    Parameters

    state

    the county, state or region of the billing address.

    Return Value

    self.

  • Set billing address city.

    Declaration

    Objective-C

    - (nonnull instancetype)withCity:(nonnull NSString *)city;

    Swift

    func withCity(_ city: String) -> Self

    Parameters

    city

    The town, district or city of the billing address.

    Return Value

    self.

  • Set billing address post code.

    Declaration

    Objective-C

    - (nonnull instancetype)withPostCode:(nonnull NSString *)postCode;

    Swift

    func withPostCode(_ postCode: String) -> Self

    Parameters

    postCode

    The postal code or zip code of the billing address.

    Return Value

    self.

  • Set billing address street1.

    Declaration

    Objective-C

    - (nonnull instancetype)withStreet1:(nonnull NSString *)street1;

    Swift

    func withStreet1(_ street1: String) -> Self

    Parameters

    street1Required

    The door number, floor, building number, building name, and/or street name of the billing address.

    Return Value

    self.

  • Set billing address street2.

    Declaration

    Objective-C

    - (nonnull instancetype)withStreet2:(nonnull NSString *)street2;

    Swift

    func withStreet2(_ street2: String) -> Self

    Parameters

    street2Required

    The adjoining road or locality (if required) of the billing address.

    Return Value

    self.

  • Update billing address country required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withCountryRequired:(BOOL)countryRequired;

    Swift

    func withCountryRequired(_ countryRequired: Bool) -> Self
  • Update billing address state required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withStateRequired:(BOOL)stateRequired;

    Swift

    func withStateRequired(_ stateRequired: Bool) -> Self
  • Update billing address city required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withCityRequired:(BOOL)cityRequired;

    Swift

    func withCityRequired(_ cityRequired: Bool) -> Self
  • Update billing address post code required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withPostCodeRequired:(BOOL)postCodeRequired;

    Swift

    func withPostCodeRequired(_ postCodeRequired: Bool) -> Self
  • Update billing address street1 required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withStreet1Required:(BOOL)street1Required;

    Swift

    func withStreet1Required(_ street1Required: Bool) -> Self
  • Update billing address street2 required flag. Default is YES.

    Declaration

    Objective-C

    - (nonnull instancetype)withStreet2Required:(BOOL)street2Required;

    Swift

    func withStreet2Required(_ street2Required: Bool) -> Self
  • Creates a new billing address.

    Declaration

    Objective-C

    - (nonnull OPPBillingAddress *)build;

    Swift

    func build() -> OPPBillingAddress

    Parameters

    error

    The error that occured while building billing address object.

    Return Value

    the billing address.