Skip to main content

BRCoupon

Describes one coupon or discount detected on a receipt.

Declaration

@interface BRCoupon : NSObject <BRSerializable>
class BRCoupon : NSObject, BRSerializable

Quick Reference

Class Methods

MethodDescription
+friendlyNameForCouponType:Converts a BRCouponType value to a user-friendly string.

Properties

PropertyDescription
couponTypeThe type of coupon, from the BRCouponType enum.
couponAmountThe amount of the coupon or discount.
couponDescCoupon description.
couponSkuCoupon SKU.
couponDescPrefixThe prefix found before the coupon description, if any.
couponDescPostfixThe postfix found after the coupon description, if any.
couponSkuPrefixThe prefix found before the coupon SKU, if any.
couponSkuPostfixThe postfix found after the coupon SKU, if any.
relatedProductIndexIf this coupon is related to a particular product, this is the index of that product in BRScanResults.products. Default: -1

Properties

couponType (read-only)

@property (nonatomic, readonly) BRCouponType couponType;
var couponType: BRCouponType { get }

The type of coupon, from the BRCouponType enum.


couponAmount (read-only)

@property (nonatomic, strong, readonly) BRFloatValue *couponAmount;
var couponAmount: BRFloatValue! { get }

The amount of the coupon or discount.


couponDesc (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponDesc;
var couponDesc: BRStringValue! { get }

Coupon description.


couponSku (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponSku;
var couponSku: BRStringValue! { get }

Coupon SKU.


couponDescPrefix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponDescPrefix;
var couponDescPrefix: BRStringValue! { get }

The prefix found before the coupon description, if any.


couponDescPostfix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponDescPostfix;
var couponDescPostfix: BRStringValue! { get }

The postfix found after the coupon description, if any.


couponSkuPrefix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponSkuPrefix;
var couponSkuPrefix: BRStringValue! { get }

The prefix found before the coupon SKU, if any.


couponSkuPostfix (read-only)

@property (nonatomic, strong, readonly) BRStringValue *couponSkuPostfix;
var couponSkuPostfix: BRStringValue! { get }

The postfix found after the coupon SKU, if any.


relatedProductIndex (read-only)

@property (nonatomic, readonly) NSInteger relatedProductIndex;
var relatedProductIndex: Int { get }

If this coupon is related to a particular product, this is the index of that product in BRScanResults.products.

Default: -1


Class Methods

+friendlyNameForCouponType:

+ (NSString *)friendlyNameForCouponType:(BRCouponType)type;
class func friendlyName(for type: BRCouponType) -> String!

Converts a BRCouponType value to a user-friendly display string.

Parameters:

ParameterDescription
typeThe BRCouponType enum value to convert

Returns: A human-readable string representation of the coupon type.