Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 5e2798961fe52ae2e6d5465624b36ff1 > files > 23

qtpurchasing5-doc-5.12.6-1.mga7.noarch.rpm

<?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>QInAppTransaction Class | Qt Purchasing 5.12.6</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.12</td><td ><a href="qtpurchasing-index.html">Qt Purchasing</a></td><td ><a href="qtpurchasing-module.html">C++ Classes</a></td><td >QInAppTransaction</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtpurchasing-index.html">Qt 5.12.6 Reference Documentation</a></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="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</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">QInAppTransaction Class</h1>
<!-- $$$QInAppTransaction-brief -->
<p>Contains information about a transaction in the external app store. <a href="#details">More...</a></p>
<!-- @@@QInAppTransaction -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QInAppTransaction&gt;</span>
</td></tr></table></div><ul>
<li><a href="qinapptransaction-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#FailureReason-enum">FailureReason</a></b> { NoFailure, CanceledByUser, ErrorOccurred }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#TransactionStatus-enum">TransactionStatus</a></b> { Unknown, PurchaseApproved, PurchaseFailed, PurchaseRestored }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qinapptransaction.html#errorString-prop">errorString</a></b> : const QString</li>
<li class="fn"><b><a href="qinapptransaction.html#failureReason-prop">failureReason</a></b> : const FailureReason</li>
<li class="fn"><b><a href="qinapptransaction.html#orderId-prop">orderId</a></b> : const QString</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qinapptransaction.html#product-prop">product</a></b> : QInAppProduct* const</li>
<li class="fn"><b><a href="qinapptransaction.html#status-prop">status</a></b> : const TransactionStatus</li>
<li class="fn"><b><a href="qinapptransaction.html#timestamp-prop">timestamp</a></b> : const QDateTime</li>
</ul>
</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#errorString-prop">errorString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QInAppTransaction::FailureReason </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#failureReason-prop">failureReason</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#finalize">finalize</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#orderId-prop">orderId</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#platformProperty">platformProperty</a></b>(const QString &amp;<i>propertyName</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QInAppProduct *</td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#product-prop">product</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QInAppTransaction::TransactionStatus </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#status-prop">status</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#timestamp-prop">timestamp</a></b>() const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qinapptransaction.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QInAppTransaction-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>Contains information about a transaction in the external app store.</p>
<p><a href="qinapptransaction.html">QInAppTransaction</a> contains information about a transaction in the external app store and is usually provided as a result of calling <a href="qinappproduct.html#purchase">QInAppProduct::purchase</a>(). When the purchase flow has been completed by the user (confirming the purchase, for instance by entering their password), the <a href="qinappstore.html">QInAppStore</a> instance containing the product will emit a <a href="qinappstore.html#transactionReady">QInAppStore::transactionReady</a>() signal with data about the transaction.</p>
<p>The <a href="qinapptransaction.html#status-prop">status</a>() 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, <a href="qinapptransaction.html#finalize">finalize</a>() should be called. The <a href="qinapptransaction.html#finalize">finalize</a>() function should be called regardless of the status of the transaction.</p>
<p>It is important that the application stores the purchase information before calling <a href="qinapptransaction.html#finalize">finalize</a>(). 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 <a href="qinappstore.html#registerProduct">QInAppStore::registerProduct</a>().</p>
<p>Transactions can also be emitted after calling <a href="qinappstore.html#restorePurchases">QInAppStore::restorePurchases</a>(), at which point a new transaction will be emitted for each previously purchased unlockable product with the status of <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseRestored</a>.</p>
<p><b>Note: </b>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.</p></div>
<!-- @@@QInAppTransaction -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$FailureReason$$$NoFailure$$$CanceledByUser$$$ErrorOccurred -->
<h3 class="fn" id="FailureReason-enum"><a name="FailureReason-enum"></a>enum QInAppTransaction::<span class="name">FailureReason</span></h3>
<p>This enum type specifies the reason for failure if a transaction has the <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseFailed</a> status.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QInAppTransaction::NoFailure</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The status of the transaction is not <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseFailed</a>.</td></tr>
<tr><td class="topAlign"><code>QInAppTransaction::CanceledByUser</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The transaction was manually canceled by the user.</td></tr>
<tr><td class="topAlign"><code>QInAppTransaction::ErrorOccurred</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">An error occurred, preventing the transaction from completing. See the <a href="qinapptransaction.html#errorString-prop">errorString</a> property for more information on the precise error that occurred.</td></tr>
</table></div>
<!-- @@@FailureReason -->
<!-- $$$TransactionStatus$$$Unknown$$$PurchaseApproved$$$PurchaseFailed$$$PurchaseRestored -->
<h3 class="fn" id="TransactionStatus-enum"><a name="TransactionStatus-enum"></a>enum QInAppTransaction::<span class="name">TransactionStatus</span></h3>
<p>This enum type is used to specify the status of the transaction.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QInAppTransaction::Unknown</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The transaction status has not been set.</td></tr>
<tr><td class="topAlign"><code>QInAppTransaction::PurchaseApproved</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The purchase was successfully completed.</td></tr>
<tr><td class="topAlign"><code>QInAppTransaction::PurchaseFailed</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">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.</td></tr>
<tr><td class="topAlign"><code>QInAppTransaction::PurchaseRestored</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The product has previously been purchased and the purchase has now been restored as a result of calling <a href="qinappstore.html#restorePurchases">QInAppStore::restorePurchases</a>().</td></tr>
</table></div>
<!-- @@@TransactionStatus -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$errorString-prop$$$errorString -->
<h3 class="fn" id="errorString-prop"><a name="errorString-prop"></a><span class="name">errorString</span> : const <span class="type">QString</span></h3>
<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>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual QString </td><td class="memItemRight bottomAlign"><span class="name"><b>errorString</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qinapptransaction.html#failureReason-prop">failureReason</a> and <a href="qinapptransaction.html#status-prop">status</a>.</p>
<!-- @@@errorString -->
<!-- $$$failureReason-prop$$$failureReason -->
<h3 class="fn" id="failureReason-prop"><a name="failureReason-prop"></a><span class="name">failureReason</span> : const <span class="type"><a href="qinapptransaction.html#FailureReason-enum">FailureReason</a></span></h3>
<p>This property holds the reason for the failure if the transaction's status is <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseFailed</a>. If the purchase was canceled by the user, the failure reason will be <a href="qinapptransaction.html#FailureReason-enum">CanceledByUser</a>. If the purchase failed due to an error, it will be <a href="qinapptransaction.html#FailureReason-enum">ErrorOccurred</a>. If the purchase did not fail, the failure reason will be <a href="qinapptransaction.html#FailureReason-enum">NoFailure</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual QInAppTransaction::FailureReason </td><td class="memItemRight bottomAlign"><span class="name"><b>failureReason</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qinapptransaction.html#errorString-prop">errorString</a> and <a href="qinapptransaction.html#status-prop">status</a>.</p>
<!-- @@@failureReason -->
<!-- $$$orderId-prop$$$orderId -->
<h3 class="fn" id="orderId-prop"><a name="orderId-prop"></a><span class="name">orderId</span> : const <span class="type">QString</span></h3>
<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>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual QString </td><td class="memItemRight bottomAlign"><span class="name"><b>orderId</b></span>() const</td></tr>
</table></div>
<!-- @@@orderId -->
<!-- $$$product-prop$$$product -->
<h3 class="fn" id="product-prop"><a name="product-prop"></a><span class="name">product</span> : <span class="type"><a href="qinappproduct.html">QInAppProduct</a></span>* const</h3>
<p>This property holds the product which is the object of this transaction.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QInAppProduct *</td><td class="memItemRight bottomAlign"><span class="name"><b>product</b></span>() const</td></tr>
</table></div>
<!-- @@@product -->
<!-- $$$status-prop$$$status -->
<h3 class="fn" id="status-prop"><a name="status-prop"></a><span class="name">status</span> : const <span class="type"><a href="qinapptransaction.html#TransactionStatus-enum">TransactionStatus</a></span></h3>
<p>This property holds the status of the transaction. If the purchase was successfully completed, the status will be <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseApproved</a>. If the purchase failed or was unsuccessful then the status will be <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseFailed</a>. If the transaction was restored as a result of calling <a href="qinappstore.html#restorePurchases">QInAppStore::restorePurchases</a>() then the status will be <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseRestored</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QInAppTransaction::TransactionStatus </td><td class="memItemRight bottomAlign"><span class="name"><b>status</b></span>() const</td></tr>
</table></div>
<!-- @@@status -->
<!-- $$$timestamp-prop$$$timestamp -->
<h3 class="fn" id="timestamp-prop"><a name="timestamp-prop"></a><span class="name">timestamp</span> : const <span class="type">QDateTime</span></h3>
<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>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual QDateTime </td><td class="memItemRight bottomAlign"><span class="name"><b>timestamp</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qinapptransaction.html#orderId-prop">orderId</a>.</p>
<!-- @@@timestamp -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$finalize[overload1]$$$finalize -->
<h3 class="fn" id="finalize"><a name="finalize"></a><code>[pure virtual] </code><span class="type">void</span> QInAppTransaction::<span class="name">finalize</span>()</h3>
<p>Call this when the application has finished performing all necessary reactions to the purchase. If the status is <a href="qinapptransaction.html#TransactionStatus-enum">PurchaseApproved</a>, the application should store the information about the transaction in a safe way before finalizing it. All transactions should be finalized.</p>
<p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.</p>
<!-- @@@finalize -->
<!-- $$$platformProperty[overload1]$$$platformPropertyconstQString& -->
<h3 class="fn" id="platformProperty"><a name="platformProperty"></a><code>[virtual] </code><span class="type">QString</span> QInAppTransaction::<span class="name">platformProperty</span>(const <span class="type">QString</span> &amp;<i>propertyName</i>) const</h3>
<p>Returns the platform-specific property given by <i>propertyName</i>.</p>
<p>The following properties are available on Google Play:</p>
<ul>
<li>AndroidSignature: The signature of the transaction, as given by the private key for the application.</li>
<li>AndroidPurchaseData: The purchase data returned by the Google Play store.</li>
</ul>
<p>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 <a href="qinappstore.html#setPlatformProperty">QInAppStore::setPlatformProperty</a>().</p>
<p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.</p>
<!-- @@@platformProperty -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>