IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Transaction QML Type

Contains information about an in-app transaction.

This type was introduced in QtPurchasing 1.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Transaction QML Type▲

  • Import Statement: import QtPurchasing 1.12

  • Since: QtPurchasing 1.0

  • Group: Transaction is part of qtpurchasing

Detailed Description▲

Transaction contains information about a transaction in the external app store and is usually provided as a result of calling purchase() on a product. When the purchase flow has ended, whether it's successful or not, either the product's onPurchaseSucceeded or onPurchaseFailed handler will be called with a transaction object as argument.

Transaction cannot be created directly in QML, but is only provided as an argument to the purchase handlers in the products.

Property Documentation▲

 

errorString : string▲

This property holds a string describing the error if the transaction failed due to an error. The contents of the error string is platform-specific.

See Also▲

See also failureReason, status

failureReason : enum▲

This property holds the reason for the failure if the transaction failed.

  • Transaction.NoFailure The transaction did not fail.

  • Transaction.CanceledByUser The transaction was canceled by the user.

  • Transaction.ErrorOccurred The transaction failed due to an error.

See Also▲

See also errorString

orderId : string▲

This property holds a unique identifier for this transaction. This value may be an empty string if no transaction was registered (for example for canceled purchases).

product : object▲

This property holds the product which is the object of this transaction.

status : enum▲

This property holds the status of the transaction.

  • Transaction.PurchaseApproved The purchase was successfully completed.

  • Transaction.PurchaseFailed The purchase was not completed for some reason. This could be because the user canceled the transaction, but it could also for example be caused by a missing network connection.

  • PurchaseRestored The product has previously been purchased and the purchase has now been restored as a result of calling restorePurchases().

timestamp : time▲

This property holds the timestamp of the transaction. The timestamp can be invalid if there is no valid transaction, for example if the user canceled the purchase.

See Also▲

See also orderId

Method Documentation▲

 

void finalize()▲

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+