StoredEntitlementTransaction

@Serializable
data class StoredEntitlementTransaction(val productId: String, val transactionId: String, val purchaseDate: Date, val originalPurchaseDate: Date, val expirationDate: Date?, val isRevoked: Boolean, val productType: EntitlementTransactionType, val willRenew: Boolean, val renewedAt: Date?, val isInGracePeriod: Boolean, val isInBillingRetryPeriod: Boolean, val isActive: Boolean) : EntitlementTransaction(source)

A serializable representation of an EntitlementTransaction that can be persisted to storage. This allows us to maintain transaction history even after purchases expire or are no longer returned by Google Play.

Constructors

Link copied to clipboard
constructor(productId: String, transactionId: String, purchaseDate: Date, originalPurchaseDate: Date, expirationDate: Date?, isRevoked: Boolean, productType: EntitlementTransactionType, willRenew: Boolean, renewedAt: Date?, isInGracePeriod: Boolean, isInBillingRetryPeriod: Boolean, isActive: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@SerialName(value = "expiration_date")
@Serializable(with = DateSerializer::class)
open override val expirationDate: Date?

The expiration date of the subscription, or null if non-expiring.

Link copied to clipboard
@SerialName(value = "is_active")
open override val isActive: Boolean

Whether the transaction is currently active.

Link copied to clipboard
@SerialName(value = "is_in_billing_retry_period")
open override val isInBillingRetryPeriod: Boolean

Whether the subscription is in a billing retry period.

Link copied to clipboard
@SerialName(value = "is_in_grace_period")
open override val isInGracePeriod: Boolean

Whether the subscription is in a grace period (payment failed but still active).

Link copied to clipboard
@SerialName(value = "is_revoked")
open override val isRevoked: Boolean

Whether this transaction has been revoked (e.g., refunded).

Link copied to clipboard
@SerialName(value = "original_purchase_date")
@Serializable(with = DateSerializer::class)
open override val originalPurchaseDate: Date

The original purchase date (for renewals, this is the first purchase).

Link copied to clipboard
@SerialName(value = "product_id")
open override val productId: String

The product identifier for this transaction.

Link copied to clipboard
@SerialName(value = "product_type")
open override val productType: EntitlementTransactionType

The type of product this transaction represents.

Link copied to clipboard
@SerialName(value = "purchase_date")
@Serializable(with = DateSerializer::class)
open override val purchaseDate: Date

The date when the purchase was made.

Link copied to clipboard
@SerialName(value = "renewed_at")
@Serializable(with = DateSerializer::class)
open override val renewedAt: Date?

The date when the subscription was last renewed, or null if not renewed.

Link copied to clipboard
@SerialName(value = "transaction_id")
open override val transactionId: String

The unique identifier for this transaction.

Link copied to clipboard
@SerialName(value = "will_renew")
open override val willRenew: Boolean

Whether the subscription will auto-renew.