PurchaseWrapper class

Data structure representing a successful purchase.

All purchase information should also be verified manually, with your server if at all possible. See "Verify a purchase".

This wraps com.android.billlingclient.api.Purchase

Annotations

Constructors

PurchaseWrapper({required String orderId, required String packageName, required int purchaseTime, required String purchaseToken, required String signature, required List<String> products, required bool isAutoRenewing, required String originalJson, String? developerPayload, required bool isAcknowledged, required PurchaseStateWrapper purchaseState, String? obfuscatedAccountId, String? obfuscatedProfileId})
Creates a purchase wrapper with the given purchase details.
const
PurchaseWrapper.fromJson(Map<String, dynamic> map)
Factory for creating a PurchaseWrapper from a Map with the purchase details.
factory

Properties

developerPayload String?
The payload specified by the developer when the purchase was acknowledged or consumed.
final
hashCode int
The hash code for this object.
no setteroverride
isAcknowledged bool
Whether the purchase has been acknowledged.
final
isAutoRenewing bool
True for subscriptions that renew automatically. Does not apply to ProductType.inapp products.
final
obfuscatedAccountId String?
The obfuscatedAccountId specified when making a purchase.
final
obfuscatedProfileId String?
The obfuscatedProfileId can be used when there are multiple profiles withing one account. The obfuscatedProfileId should be specified when making a purchase. This property can only be set on a purchase by directly calling BillingClient.launchBillingFlow and is not available on the generic InAppPurchasePlatform.
final
orderId String
The unique ID for this purchase. Corresponds to the Google Payments order ID.
final
originalJson String
Details about this purchase, in JSON.
final
packageName String
The package name the purchase was made from.
final
products List<String>
The product IDs of this purchase.
final
purchaseState PurchaseStateWrapper
Determines the current state of the purchase.
final
purchaseTime int
When the purchase was made, as an epoch timestamp.
final
purchaseToken String
A unique ID for a given ProductDetailsWrapper, user, and purchase.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature String
Signature of purchase data, signed with the developer's private key. Uses RSASSA-PKCS1-v1_5.
final

Methods

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.
override