Inherits from NSObject
Declared in RECoupon.h

Overview

Encapsulates the response of a RECouponRequest.

Tasks

Properties

code

@property (nonatomic, readonly) NSString *code
Discussion

Coupon code

Declared In

RECoupon.h

discountAmount

@property (nonatomic, readonly) NSDictionary *discountAmount
Discussion

Fixed discount amount, but the fixed amount is not unique, it may be different for each supported currency.

this value may be nil, if the discount is a fixed amount

Declared In

RECoupon.h

discountRate

@property (nonatomic, readonly) NSDecimalNumber *discountRate
Discussion

Discount rate

this value may be nil, if the discount is a fixed amount

Declared In

RECoupon.h

name

@property (nonatomic, readonly) NSString *name
Discussion

Coupon name

Declared In

RECoupon.h

type

@property (nonatomic, readonly) NSString *type
Discussion

Coupon type, it can be a rated discount or a fixed amount

Declared In

RECoupon.h

Instance Methods

discountForSubtotal:currency:

- (NSDecimalNumber *)discountForSubtotal:(NSDecimalNumber *)subtotal currency:(NSString *)currency
Discussion

Calculates the discount amount (absolute value) for a given subtotal and currency.

The amount can be fixed or a rate of the subtotal, use this method to calculate it properly. Do not implement it by yourself.

Parameters

subtotal

Subtotal

currency

Currency

Declared In

RECoupon.h