-
public final class DiscountOfferStandardized one-time product discount offer. Provides a platform-neutral OpenIAP shape for Google Play one-time product purchase options and offers.
Currently populated only on Android (Google Play Billing 8.0+). iOS does not populate this type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDiscountOffer.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringcurrencyprivate final StringdiscountAmountMicrosAndroidprivate final StringdisplayPriceprivate final StringformattedDiscountAmountAndroidprivate final StringfullPriceMicrosAndroidprivate final Stringidprivate final LimitedQuantityInfoAndroidlimitedQuantityInfoAndroidprivate final List<String>offerTagsAndroidprivate final StringofferTokenAndroidprivate final IntegerpercentageDiscountAndroidprivate final PreorderDetailsAndroidpreorderDetailsAndroidprivate final Doublepriceprivate final StringpurchaseOptionIdAndroidprivate final RentalDetailsAndroidrentalDetailsAndroidprivate final DiscountOfferTypetypeprivate final ValidTimeWindowAndroidvalidTimeWindowAndroid
-
Constructor Summary
Constructors Constructor Description DiscountOffer(String currency, String discountAmountMicrosAndroid, String displayPrice, String formattedDiscountAmountAndroid, String fullPriceMicrosAndroid, String id, LimitedQuantityInfoAndroid limitedQuantityInfoAndroid, List<String> offerTagsAndroid, String offerTokenAndroid, Integer percentageDiscountAndroid, PreorderDetailsAndroid preorderDetailsAndroid, Double price, String purchaseOptionIdAndroid, RentalDetailsAndroid rentalDetailsAndroid, DiscountOfferType type, ValidTimeWindowAndroid validTimeWindowAndroid)
-
Method Summary
Modifier and Type Method Description final StringgetCurrency()Currency code (ISO 4217, e.g. final StringgetDiscountAmountMicrosAndroid()Android Fixed discount amount in micro-units. final StringgetDisplayPrice()Formatted display price string (e.g., "$4. final StringgetFormattedDiscountAmountAndroid()Android Formatted discount amount including its currency sign (e.g., "$5.00"). final StringgetFullPriceMicrosAndroid()Android Original full price in micro-units before discount. final StringgetId()Unique identifier for the offer. final LimitedQuantityInfoAndroidgetLimitedQuantityInfoAndroid()Android Limited quantity information. final List<String>getOfferTagsAndroid()Android List of tags associated with this offer. final StringgetOfferTokenAndroid()Android Offer token required for purchase. final IntegergetPercentageDiscountAndroid()Android Percentage discount (e.g., 33 for 33% off). final PreorderDetailsAndroidgetPreorderDetailsAndroid()Android Pre-order details if this is a pre-order offer. final DoublegetPrice()Numeric price value final StringgetPurchaseOptionIdAndroid()Android Purchase option ID for this offer. final RentalDetailsAndroidgetRentalDetailsAndroid()Android Rental details if this is a rental offer. final DiscountOfferTypegetType()Offer category. final ValidTimeWindowAndroidgetValidTimeWindowAndroid()Android Valid time window for the offer. final Map<String, Object>toJson()-
-
Constructor Detail
-
DiscountOffer
DiscountOffer(String currency, String discountAmountMicrosAndroid, String displayPrice, String formattedDiscountAmountAndroid, String fullPriceMicrosAndroid, String id, LimitedQuantityInfoAndroid limitedQuantityInfoAndroid, List<String> offerTagsAndroid, String offerTokenAndroid, Integer percentageDiscountAndroid, PreorderDetailsAndroid preorderDetailsAndroid, Double price, String purchaseOptionIdAndroid, RentalDetailsAndroid rentalDetailsAndroid, DiscountOfferType type, ValidTimeWindowAndroid validTimeWindowAndroid)
-
-
Method Detail
-
getCurrency
final String getCurrency()
Currency code (ISO 4217, e.g., "USD")
-
getDiscountAmountMicrosAndroid
final String getDiscountAmountMicrosAndroid()
Android Fixed discount amount in micro-units. Only present for fixed amount discounts.
-
getDisplayPrice
final String getDisplayPrice()
Formatted display price string (e.g., "$4.99")
-
getFormattedDiscountAmountAndroid
final String getFormattedDiscountAmountAndroid()
Android Formatted discount amount including its currency sign (e.g., "$5.00").
-
getFullPriceMicrosAndroid
final String getFullPriceMicrosAndroid()
Android Original full price in micro-units before discount. Divide by 1,000,000 to get the actual price. Use for displaying strikethrough original price.
-
getId
final String getId()
Unique identifier for the offer.
iOS: Not applicable (one-time discounts not supported)
Android: offerId from the Google Play one-time purchase option
-
getLimitedQuantityInfoAndroid
final LimitedQuantityInfoAndroid getLimitedQuantityInfoAndroid()
Android Limited quantity information. Contains maximumQuantity and remainingQuantity.
-
getOfferTagsAndroid
final List<String> getOfferTagsAndroid()
Android List of tags associated with this offer.
-
getOfferTokenAndroid
final String getOfferTokenAndroid()
Android Offer token required for purchase. Must be passed to requestPurchase() when purchasing with this offer.
-
getPercentageDiscountAndroid
final Integer getPercentageDiscountAndroid()
Android Percentage discount (e.g., 33 for 33% off). Only present for percentage-based discounts.
-
getPreorderDetailsAndroid
final PreorderDetailsAndroid getPreorderDetailsAndroid()
Android Pre-order details if this is a pre-order offer. Available in Google Play Billing Library 8.1.0+
-
getPurchaseOptionIdAndroid
final String getPurchaseOptionIdAndroid()
Android Purchase option ID for this offer. Used to identify which purchase option the user selected. Available in Google Play Billing Library 8.0+
-
getRentalDetailsAndroid
final RentalDetailsAndroid getRentalDetailsAndroid()
Android Rental details if this is a rental offer.
-
getType
final DiscountOfferType getType()
Offer category. DiscountOffer currently represents Android one-time product offers and is populated as OneTime. Introductory and Promotional are used by SubscriptionOffer.
-
getValidTimeWindowAndroid
final ValidTimeWindowAndroid getValidTimeWindowAndroid()
Android Valid time window for the offer. Contains startTimeMillis and endTimeMillis.
-
-
-
-