Additional Inherited Members

Detailed Description

Contains information about a transaction in the external app store

QInAppTransaction contains information about a transaction in the external app store and is usually provided as a result of calling QInAppProduct::purchase(). When the purchase flow has been completed by the user (confirming the purchase, for instance by entering their password), the QInAppStore instance containing the product will emit a QInAppStore::transactionReady() signal with data about the transaction.

The status() provides information on whether the transaction was successful or not. If it was successful, then the application should take appropriate action. When the necessary action has been performed, finalize() should be called. The finalize() function should be called regardless of the status of the transaction.

It is important that the application stores the purchase information before calling finalize(). If a transaction is not finalized (for example because the application was interrupted before it had a chance to save the information), then the transaction will be emitted again the next time the product is registered by QInAppStore::registerProduct().

Note: Since transactions may under certain circumstances be emitted for the same transaction several times, the application should always check if the transaction has been registered before. Do not expect each transaction to be unique.

Member Type Documentation

enum QInAppTransaction::FailureReason

This enum type specifies the reason for failure if a transaction has the PurchaseFailed status.

This property holds the reason for the failure if the transaction's status is PurchaseFailed. If the purchase was canceled by the user, the failure reason will be CanceledByUser. If the purchase failed due to an error, it will be ErrorOccurred. If the purchase did not fail, the failure reason will be NoFailure.

Member Function Documentation

[pure virtual] void QInAppTransaction::finalize()

Call this when the application has finished performing all necessary reactions to the purchase. If the status is PurchaseApproved, the application should store the information about the transaction in a safe way before finalizing it. All transactions should be finalized.

AndroidSignature: The signature of the transaction, as given by the private key for the application.

AndroidPurchaseData: The purchase data returned by the Google Play store.

These properties can be used to verify the purchase using the public key of your application. It is also possible to have the back-end verify the purchases by passing in the public key before registering products, using QInAppStore::setPlatformProperty().