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.
-
The id of the
VOVoucher. This will be unique for eachVOVoucherand never change.Declaration
Objective-C
@property (readonly, nonatomic) long long vId;Swift
var vId: Int64 { get } -
The status of the
VOVoucher. SeeVOVoucherStatusfor 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 } -
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
VOVoucherwas modified. Anytime a value changes in theVOVoucher, this property will update.Declaration
Objective-C
@property (readonly, strong, nonatomic) NSDate *_Nonnull dateModified;Swift
var dateModified: Date { get } -
The date the
VOVoucherwas created. This date will never change.Declaration
Objective-C
@property (readonly, strong, nonatomic) NSDate *_Nonnull dateCreated;Swift
var dateCreated: Date { get } -
The date the
VOVoucheris 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 } -
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 theVOVoucher.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
VOUsermust play to claim theVOVoucher.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
VOWrappingPaperMediathat shows up on the envelope before theVOVoucherhas 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 } -
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 callsinitWithDictionary:.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
VOVoucherto 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
VOVoucherto 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
VOVoucherwithout media data.
View on GitHub
VOVoucher Class Reference