VOMutableVoucher
@interface VOMutableVoucher : VOVoucher
VOMutableVoucher
is the mutable model that represents the bundle of personalizations.
-
The status of the
VOVoucher
. SeeVOVoucherStatus
for all the possible states.Declaration
Objective-C
@property (assign, readwrite, nonatomic) VOVoucherStatus status;
Swift
var status: VOVoucherStatus { get set }
-
The amount that is given to the
VOUser
.Declaration
Objective-C
@property (assign, readwrite, nonatomic) double amount;
Swift
var amount: Double { get set }
-
The fee associated with the given amount.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) double fee;
Swift
var fee: Double { get set }
-
The currency of the
VOVoucher
. Eg. USD.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSString *currency;
Swift
var currency: String? { get set }
-
The merchant associated with the
VOVoucher
. Eg. Paypal.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) VOMerchant *merchant;
Swift
var merchant: VOMerchant? { get set }
-
The payment info provided by the Sender of the
VOVoucher
.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) VOVoucherPayment *paymentInfo;
Swift
var paymentInfo: VOVoucherPayment? { get set }
-
Require a thank you photo to be taken by the claimer of the
VOVoucher
before they are able to claim it.Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL isThankYouPhotoRequired;
Swift
var isThankYouPhotoRequired: Bool { get set }
-
The date the thank you photo was taken for a
VOVoucher
.Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) NSDate *thankYouDate;
Swift
var thankYouDate: Date? { get set }
-
The date the
VOVoucher
was created. This date will never change.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSDate *_Nonnull dateCreated;
Swift
var dateCreated: Date { get set }
-
The date the
VOVoucher
is first able to be claimed. This date will never change.Declaration
Objective-C
@property (readwrite, strong, nonatomic) NSDate *_Nonnull dateClaimable;
Swift
var dateClaimable: Date { get set }
-
Any user ids who have unwrapped the
VOVoucher
.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSArray<NSNumber *> *unwrappedUsers;
Swift
var unwrappedUsers: [NSNumber]? { get set }
-
TODO: this property
Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSString *shareImageUrl;
Swift
var shareImageUrl: String? { get set }
-
The privacy status of the
VOVoucher
. Either Private / Friends / Public.Declaration
Objective-C
@property (assign, readwrite, nonatomic) VOVoucherPrivacyStatus privacy;
Swift
var privacy: VOVoucherPrivacyStatus { get set }
-
The game the
User
must play to claim theVOVoucher
.Declaration
Objective-C
@property (readwrite, strong, nonatomic) VOGameData *_Nonnull gameData;
Swift
var gameData: VOGameData { get set }
-
An array of all media items. This includes pictures, videos, sounds, notes. Customizable by the user when sending the
VOVoucher
.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) NSArray<VOVoucherMedia *> *medias;
Swift
var medias: [VOVoucherMedia]? { get set }
-
The wrapping paper that shows up on the envelope before the
VOVoucher
has been claimed.Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) VOWrappingPaperMedia *wrappingPaperMedia;
Swift
var wrappingPaperMedia: VOWrappingPaperMedia? { get set }
-
Default initializer to create a
VOMutableVoucher
.Declaration
Objective-C
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dictionary;
Swift
init(dictionary: [AnyHashable : Any])
Parameters
dictionary
- the dictionary representation of the the
VOMutableVoucher
.Return Value
instance of
VOMutableVoucher
. -
Static initializer to create a
VOMutableVoucher
.Declaration
Objective-C
+ (nonnull instancetype)mutableVoucherWithDictionary: (nonnull NSDictionary *)dictionary;
Parameters
dictionary
- the dictionary representation of the the
VOMutableVoucher
.Return Value
instance of
VOMutableVoucher
. -
Static initializer to create a
VOMutableVoucher
from anotherVOVoucher
. All properties of the VOVoucher will be copied to theVOMutableVoucher
.Declaration
Objective-C
+ (nonnull instancetype)mutableVoucherWithVoucher:(nonnull VOVoucher *)voucher;
Swift
convenience init(voucher: VOVoucher)
Parameters
voucher
- VOVoucher used to create the
VOMutableVoucher
.Return Value
instance of
VOMutableVoucher
. -
Copies the contents of a preexisting voucher into the current voucher
Declaration
Objective-C
- (void)replaceVoucherContents:(nonnull VOMutableVoucher *)mutableVoucher;
Swift
func replaceContents(_ mutableVoucher: VOMutableVoucher)
Parameters
mutableVoucher
- the source voucher to copy contents from
-
Adds a media object to the
VOVoucherMedia
array. If no id is set on theVOVoucherMedia
item, an id will be given.Declaration
Objective-C
- (void)addMedia:(nonnull VOVoucherMedia *)media;
Swift
func addMedia(_ media: VOVoucherMedia)
Parameters
media
- The media item to add to the array.
-
Removes a media object from the
VOVoucherMedia
array. If no id is set on theVOVoucherMedia
item, an id will be given.Declaration
Objective-C
- (void)removeMedia:(nonnull VOVoucherMedia *)media;
Swift
func removeMedia(_ media: VOVoucherMedia)
Parameters
media
- The media item to be removed from the array
-
Removes a
VOPersonalizationOption
creation item from theVOVoucher
.Declaration
Objective-C
- (void)removeCreationObjectFromVoucher: (nonnull VOCreationItemView *)creationItem;
Swift
func removeCreationObject(fromVoucher creationItem: VOCreationItemView)
Parameters
creationItem
- The creation item of a
VOPersonalizationOption
to be removed from theVOVoucher
. -
Clears the
VOPersonalizationOption
contents of aVOMutableVoucher
. Does not modifyVOVoucher
specific properties such as vId and status.Declaration
Objective-C
- (void)clearMutableVoucherData;
Swift
func clearData()