MagicStarterCampaignDiscount class
What a campaign takes off, as the backend snapshotted it from the Stripe coupon behind the promotion code.
- Annotations
Constructors
-
MagicStarterCampaignDiscount({required MagicStarterCampaignDiscountType type, required num value, String? currency, Map<
String, num> currencyOptions = const <String, num>{}}) -
const
-
MagicStarterCampaignDiscount.fromMap(Map<
String, dynamic> map) -
Decodes the wire object
{"type": "percent"|"amount", "value", "currency", "currency_options"}.factory
Properties
- currency → String?
-
The ISO 4217 code of an MagicStarterCampaignDiscountType.amount
discount,
nullfor a percent.final -
currencyOptions
→ Map<
String, num> -
What an MagicStarterCampaignDiscountType.amount discount takes off in
each currency the coupon prices, keyed by lowercase ISO 4217 code, in that
currency's minor unit. Empty for a percent and for a coupon with no
per-currency amounts; read it through amountIn.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → MagicStarterCampaignDiscountType
-
Whether value is a percent or an amount.
final
- value → num
-
The percent, or the amount in the minor unit (cents, kurus) of currency.
final
Methods
-
amountIn(
String currency) → num? -
The minor-unit amount this discount takes off in
currency(any case), ornullwhen the coupon prices no such currency. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited