PurchaseResult
Represents the result of a purchase transaction with comprehensive details. This class wraps all information from Google Play Billing Library's Purchase object.
Constructors
Link copied to clipboard
constructor()
Default constructor for manual creation.
constructor(orderId: String, packageName: String, productIds: List<String>, purchaseTime: Long, purchaseState: Int, purchaseToken: String, quantity: Int, autoRenewing: Boolean, acknowledged: Boolean)
Legacy constructor for backward compatibility.
constructor(orderId: String, packageName: String, productIds: List<String>, purchaseTime: Long, purchaseState: Int, purchaseToken: String, quantity: Int, autoRenewing: Boolean, acknowledged: Boolean, originalJson: String, signature: String, obfuscatedAccountId: String, obfuscatedProfileId: String)
Full constructor with all fields.
Types
Properties
Functions
Link copied to clipboard
Checks if this purchase contains a specific product ID.
Link copied to clipboard
Creates a PurchaseResult from a Google Play Purchase object.
Link copied to clipboard
Gets the consumed time as a formatted date string.
Link copied to clipboard
Gets the first (primary) product ID.
Link copied to clipboard
Link copied to clipboard
Gets the product IDs as a comma-separated string.
Link copied to clipboard
Gets the purchase time as a Date object.
Link copied to clipboard
Gets the purchase state as a readable string.
Link copied to clipboard
Gets the purchase time as a formatted date string in default format.
Gets the purchase time as a formatted date string.
Link copied to clipboard
Gets the subscription state based on available client-side data.
Link copied to clipboard
Gets a human-readable subscription status string.
Link copied to clipboard
Checks if account identifiers are available.
Link copied to clipboard
Checks if this purchase has the necessary data for server-side verification.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Checks if the purchase is in PURCHASED state.
Link copied to clipboard
Checks if this is a subscription purchase.
Link copied to clipboard
Checks if the subscription is active (user has access).
Link copied to clipboard
Checks if the user cancelled their subscription.
Link copied to clipboard
Marks this purchase as consumed.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Checks if the subscription will renew.