ProductDetails.OneTimePurchaseOfferDetails.DiscountDisplayInfo

public final class ProductDetails.OneTimePurchaseOfferDetails.DiscountDisplayInfo


Represents discount display information about a discounted one-time product offer.

Exactly one of percentageDiscount or discountAmount will be set at any given time.

Summary

Nested types

Represents a discount amount.

Public methods

ProductDetails.OneTimePurchaseOfferDetails.DiscountDisplayInfo.DiscountAmount

Returns the absolute discount of an item.

Integer

Returns the percentage discount of an item.

Public methods

getDiscountAmount

public ProductDetails.OneTimePurchaseOfferDetails.DiscountDisplayInfo.DiscountAmount getDiscountAmount()

Returns the absolute discount of an item.

Disclaimer: Please use the discountAmount field for display purposes only, and do not use it to calculate the final offer price. Please use the getPriceAmountMicros field to get the offer price.

For example, if the original price is $9.99, the discount is $4.99, then the discounted offer price will be $5.00.

Note: Returns null for offers without a discount amount.

getPercentageDiscount

public Integer getPercentageDiscount()

Returns the percentage discount of an item.

For example, if discount is "40%", the percentageDiscount is "40".

Disclaimer: Please use the percentageDiscount field for display purposes only, and do not use it to calculate the final offer price. Please use the getPriceAmountMicros field to get the offer price.

For example, if the original price is $9.99, the discount is 50%, then the discounted offer price will be $5.00.

Note: Returns null for offers without a percentage discount.