PurchaseDetails class

Represents the transaction details of a purchase.

This class unifies the BillingClient's PurchaseWrapper and StoreKit's SKPaymentTransactionWrapper. You can use the common attributes in This class for simple operations. If you would like to see the detailed representation of the product, instead, use PurchaseWrapper on Android and SKPaymentTransactionWrapper on iOS.

Constructors

PurchaseDetails({@required String purchaseID, @required String productID, @required PurchaseVerificationData verificationData, @required String transactionDate, SKPaymentTransactionWrapper skPaymentTransaction, PurchaseWrapper billingClientPurchase})
PurchaseDetails.fromPurchase(PurchaseWrapper purchase)
Generate a PurchaseDetails object based on an Android Purchase object.
PurchaseDetails.fromSKTransaction(SKPaymentTransactionWrapper transaction, String base64EncodedReceipt)
Generate a PurchaseDetails object based on an iOS SKTransactionWrapper object.

Properties

billingClientPurchase PurchaseWrapper
Points back to the BillingClient's PurchaseWrapper object that generated this PurchaseDetails object. [...]
final
error IAPError
The error is only available when status is PurchaseStatus.error.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
pendingCompletePurchase bool
The developer has to call InAppPurchaseConnection.completePurchase if the value is true and the product has been delivered to the user. [...]
read-only
productID String
The product identifier of the purchase.
final
purchaseID String
A unique identifier of the purchase.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
skPaymentTransaction SKPaymentTransactionWrapper
Points back to the StoreKits's SKPaymentTransactionWrapper object that generated this PurchaseDetails object. [...]
final
status PurchaseStatus
The status that this PurchaseDetails is currently on.
read / write
transactionDate String
The timestamp of the transaction. [...]
final
verificationData PurchaseVerificationData
The verification data of the purchase. [...]
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited