VOVoucher

@interface VOVoucher : NSObject <NSCoding>

VOVoucher is the model that encompases all components of a ‘gift’. This class is immutable. Use VOMutableVoucher if you need to change values.

  • vId

    The id of the VOVoucher. This will be unique for each VOVoucher and never change.

    Declaration

    Objective-C

    @property (readonly, nonatomic) long long vId;

    Swift

    var vId: Int64 { get }
  • The status of the VOVoucher. See VOVoucherStatus for all the possible states.

    Declaration

    Objective-C

    @property (readonly, nonatomic) VOVoucherStatus status;

    Swift

    var status: VOVoucherStatus { get }
  • The amount that is given to the VOUser.

    Declaration

    Objective-C

    @property (readonly, nonatomic) double amount;

    Swift

    var amount: Double { get }
  • fee

    The fee associated with the given amount.

    Declaration

    Objective-C

    @property (readonly, nonatomic) double fee;

    Swift

    var fee: Double { get }
  • The currency of the gift. Eg. USD.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *currency;

    Swift

    var currency: String? { get }
  • The merchant associated with the VOVoucher. Eg. Paypal.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) VOMerchant *merchant;

    Swift

    var merchant: VOMerchant? { get }
  • The payment info provided by the Sender of the gift.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) VOVoucherPayment *paymentInfo;

    Swift

    var paymentInfo: VOVoucherPayment? { get }
  • Require a thank you photo to be taken by the claimer of the gift before they are able to claim it.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL isThankYouPhotoRequired;

    Swift

    var isThankYouPhotoRequired: Bool { get }
  • The date the thank you photo was taken for a gift.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSDate *thankYouDate;

    Swift

    var thankYouDate: Date? { get }
  • The last date the VOVoucher was modified. Anytime a value changes in the VOVoucher, this property will update.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSDate *_Nonnull dateModified;

    Swift

    var dateModified: Date { get }
  • The date the VOVoucher was created. This date will never change.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSDate *_Nonnull dateCreated;

    Swift

    var dateCreated: Date { get }
  • The date the VOVoucher is first able to be claimed. This date will never change.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSDate *_Nonnull dateClaimable;

    Swift

    var dateClaimable: Date { get }
  • The creator of the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) VOUser *_Nonnull creator;

    Swift

    var creator: VOUser { get }
  • The claimer of the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) VOUser *claimer;

    Swift

    var claimer: VOUser? { get }
  • Any VOUsers who are able to view the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSArray<VOUser *> *viewers;

    Swift

    var viewers: [VOUser]? { get }
  • Any VOUsers who are able to claim the VOVoucher before it has been claimed.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSArray<VOUser *> *recipients;

    Swift

    var recipients: [VOUser]? { get }
  • Any user ids who have unwrapped the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        NSArray<NSNumber *> *unwrappedUsers;

    Swift

    var unwrappedUsers: [NSNumber]? { get }
  • The title of the VOVoucher. Customizable by the user when creating the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *title;

    Swift

    var title: String? { get }
  • TODO: this property

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) NSString *shareImageUrl;

    Swift

    var shareImageUrl: String? { get }
  • The privacy status of the VOVoucher. Either Private / Friends / Public.

    Declaration

    Objective-C

    @property (readonly, nonatomic) VOVoucherPrivacyStatus privacy;

    Swift

    var privacy: VOVoucherPrivacyStatus { get }
  • The game the VOUser must play to claim the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, nonatomic) VOGameData *_Nonnull gameData;

    Swift

    var gameData: VOGameData { get }
  • An array of all media items. This includes pictures, videos, sounds, notes. Customizable by the user when sending the VOVoucher.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        NSArray<VOVoucherMedia *> *medias;

    Swift

    var medias: [VOVoucherMedia]? { get }
  • The VOWrappingPaperMedia that shows up on the envelope before the VOVoucher has been claimed.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        VOWrappingPaperMedia *wrappingPaperMedia;

    Swift

    var wrappingPaperMedia: VOWrappingPaperMedia? { get }
  • Boolean value that tracks if the voucher was prepopulated from ‘VOPreviewVoucherContentsViewController’

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL isPrepopulated;

    Swift

    var isPrepopulated: Bool { get set }
  • The template ID if the voucher was created from a template, 0 otherwise

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) long long templateId;

    Swift

    var templateId: Int64 { get set }
  • The category ID if the voucher was created from a template that belongs to a category, 0 otherwise

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) long long templateCategoryId;

    Swift

    var templateCategoryId: Int64 { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, nullable) VOPromo *promo

    Swift

    var promo: VOPromo? { get set }
  • Default initializer to create a VOVoucher.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dictionary;

    Swift

    init(dictionary: [AnyHashable : Any])

    Parameters

    dictionary

    - the dictionary representation of the the VOVoucher.

    Return Value

    instance of VOVoucher.

  • Static initializer to create a VOVoucher. Internally calls initWithDictionary:.

    Declaration

    Objective-C

    + (nonnull instancetype)voucherWithDictionary:
        (nonnull NSDictionary *)dictionary;

    Parameters

    dictionary

    - the dictionary representation of the the VOVoucher.

    Return Value

    instance of VOVoucher.

  • Converts a VOVoucher to an NSDictionary that can be used for caching.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)dictionaryRepresentation;

    Swift

    func dictionaryRepresentation() -> [AnyHashable : Any]

    Return Value

    dictionary - Dictionary form of a VOVoucher.

  • Converts a VOVoucher to an NSDictionary that can be used for sending to the server.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)dictionaryRepresentationForNetwork;

    Swift

    func dictionaryRepresentationForNetwork() -> [AnyHashable : Any]

    Return Value

    dictionary - Dictionary form of a VOVoucher without media data.