<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qinapptransaction.cpp --> <title>Transaction QML Type | Qt Purchasing 5.9</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.9</td><td ><a href="qtpurchasing-index.html">Qt Purchasing</a></td><td ><a href="qtpurchasing-qmlmodule.html">QML Types</a></td><td >Transaction QML Type</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#methods">Methods</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Transaction QML Type</h1> <span class="subtitle"></span> <!-- $$$Transaction-brief --> <p>Contains information about an in-app transaction. <a href="#details">More...</a></p> <!-- @@@Transaction --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtPurchasing 1.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> QtPurchasing 1.0</td></tr></table></div><ul> <li><a href="qml-qtpurchasing-transaction-members.html">List of all members, including inherited members</a></li> </ul> <a name="properties"></a> <h2 id="properties">Properties</h2> <ul> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#errorString-prop">errorString</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#failureReason-prop">failureReason</a></b></b> : enum</li> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#orderId-prop">orderId</a></b></b> : string</li> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#product-prop">product</a></b></b> : object</li> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#status-prop">status</a></b></b> : enum</li> <li class="fn"><b><b><a href="qml-qtpurchasing-transaction.html#timestamp-prop">timestamp</a></b></b> : time</li> </ul> <a name="methods"></a> <h2 id="methods">Methods</h2> <ul> <li class="fn">void <b><b><a href="qml-qtpurchasing-transaction.html#finalize-method">finalize</a></b></b>()</li> </ul> <!-- $$$Transaction-description --> <a name="details"></a> <h2 id="details">Detailed Description</h2> <p>Transaction contains information about a transaction in the external app store and is usually provided as a result of calling <a href="qml-qtpurchasing-product.html#purchase-method">purchase()</a> on a product. When the purchase flow has ended, whether it's successful or not, either the product's <a href="qml-qtpurchasing-product.html#onPurchaseSucceeded-signal">onPurchaseSucceeded</a> or <a href="qml-qtpurchasing-product.html#onPurchaseFailed-signal">onPurchaseFailed</a> handler will be called with a transaction object as argument.</p> <p>Transaction cannot be created directly in QML, but is only provided as an argument to the purchase handlers in the products.</p> <!-- @@@Transaction --> <h2>Property Documentation</h2> <!-- $$$errorString --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="errorString-prop"> <td class="tblQmlPropNode"><p> <a name="errorString-prop"></a><span class="name">errorString</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>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.</p> <p><b>See also </b><a href="qml-qtpurchasing-transaction.html#failureReason-prop">failureReason</a> and <a href="qml-qtpurchasing-transaction.html#status-prop">status</a>.</p> </div></div><!-- @@@errorString --> <br/> <!-- $$$failureReason --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="failureReason-prop"> <td class="tblQmlPropNode"><p> <a name="failureReason-prop"></a><span class="name">failureReason</span> : <span class="type">enum</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the reason for the failure if the transaction failed.</p> <ul> <li>Transaction.NoFailure The transaction did not fail.</li> <li>Transaction.CanceledByUser The transaction was canceled by the user.</li> <li>Transaction.ErrorOccurred The transaction failed due to an error.</li> </ul> <p><b>See also </b><a href="qml-qtpurchasing-transaction.html#errorString-prop">errorString</a>.</p> </div></div><!-- @@@failureReason --> <br/> <!-- $$$orderId --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="orderId-prop"> <td class="tblQmlPropNode"><p> <a name="orderId-prop"></a><span class="name">orderId</span> : <span class="type">string</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>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).</p> </div></div><!-- @@@orderId --> <br/> <!-- $$$product --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="product-prop"> <td class="tblQmlPropNode"><p> <a name="product-prop"></a><span class="name">product</span> : <span class="type">object</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the product which is the object of this transaction.</p> </div></div><!-- @@@product --> <br/> <!-- $$$status --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="status-prop"> <td class="tblQmlPropNode"><p> <a name="status-prop"></a><span class="name">status</span> : <span class="type">enum</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds the status of the transaction.</p> <ul> <li>Transaction.PurchaseApproved The purchase was successfully completed.</li> <li>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.</li> <li>PurchaseRestored The product has previously been purchased and the purchase has now been restored as a result of calling <a href="qml-qtpurchasing-store.html#restorePurchases-method">restorePurchases()</a>.</li> </ul> </div></div><!-- @@@status --> <br/> <!-- $$$timestamp --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="timestamp-prop"> <td class="tblQmlPropNode"><p> <a name="timestamp-prop"></a><span class="name">timestamp</span> : <span class="type">time</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>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.</p> <p><b>See also </b><a href="qml-qtpurchasing-transaction.html#orderId-prop">orderId</a>.</p> </div></div><!-- @@@timestamp --> <br/> <h2>Method Documentation</h2> <!-- $$$finalize --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="finalize-method"> <td class="tblQmlFuncNode"><p> <a name="finalize-method"></a><span class="type">void</span> <span class="name">finalize</span>()</p></td></tr> </table></div> </div><div class="qmldoc"><p>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.</p> </div></div><!-- @@@finalize --> <br/> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>