# PurchaseData

## PurchaseData <a href="#id-cn-purchasedata-purchasedata" id="id-cn-purchasedata-purchasedata"></a>

`public class PurchaseData extends Object`\
`java.lang.Object`     \
&#x20;    `↳ com.gaa.sdk.iap.PurchaseData`\
&#x20;\
显示In-App支付的购买数据。

## Summary <a href="#id-cn-purchasedata-summary" id="id-cn-purchasedata-summary"></a>

<table data-header-hidden><thead><tr><th width="197"></th><th></th></tr></thead><tbody><tr><td><strong>Nested classes</strong></td><td><br></td></tr><tr><td>@interface</td><td><a href="../annotations/purchasedata.acknowledgestate">PurchaseData.AcknowledgeState</a></td></tr><tr><td>@interface</td><td><a href="../annotations/purchasedata.purchasestate">PurchaseData.PurchaseState</a></td></tr><tr><td>@interface</td><td><a href="../annotations/purchasedata.recurringstate">PurchaseData.RecurringState</a></td></tr></tbody></table>



| **Public constructors**                                 |
| ------------------------------------------------------- |
| PurchaseData(String jsonPurchaseData)                   |
| PurchaseData(String jsonPurchaseData, String signature) |

## Public methods <a href="#id-cn-purchasedata-publicmethods" id="id-cn-purchasedata-publicmethods"></a>

***

### getOrderId <a href="#id-cn-purchasedata-getorderid" id="id-cn-purchasedata-getorderid"></a>

`String getOrderId()`

返回购买相关的订购ID。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPackageName <a href="#id-cn-purchasedata-getpackagename" id="id-cn-purchasedata-getpackagename"></a>

`String getPackageName()`

返回开始购买的应用软件packageName。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getProductId <a href="#id-cn-purchasedata-getproductid" id="id-cn-purchasedata-getproductid"></a>

`String getProductId()`

返回购买的In-App商品的ID。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseTime <a href="#id-cn-purchasedata-getpurchasetime" id="id-cn-purchasedata-getpurchasetime"></a>

`long getPurchaseTime()`

以毫秒为单位返回购买In-App商品的时间。\
&#x20;

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| long         | <p><br></p> |

### isAcknowledged <a href="#id-cn-purchasedata-isacknowledged" id="id-cn-purchasedata-isacknowledged"></a>

`boolean isAcknowledged()`

显示购买是否被确认(acknowledge)。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| boolean      | <p><br></p> |

### getDeveloperPayload <a href="#id-cn-purchasedata-getdeveloperpayload" id="id-cn-purchasedata-getdeveloperpayload"></a>

`String getDeveloperPayload()`

发送在确认(acknowledge) 或消费(consume)购买时指定的开发公司的Payload。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseId <a href="#id-cn-purchasedata-getpurchaseid" id="id-cn-purchasedata-getpurchaseid"></a>

`@Deprecated String getPurchaseId()`

返回购买数据的唯一识别ID。 在API v6中不使用。

| **Returns:**       |
| ------------------ |
| String             |
| **See Also:**      |
| getPurchaseToken() |

### getPurchaseToken <a href="#id-cn-purchasedata-getpurchasetoken" id="id-cn-purchasedata-getpurchasetoken"></a>

`String getPurchaseToken()`

返回唯一识别购买数据的token。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getPurchaseState <a href="#id-cn-purchasedata-getpurchasestate" id="id-cn-purchasedata-getpurchasestate"></a>

`int getPurchaseState()`

作为购买状态的值，返回[PurchaseData.PurchaseState](../annotations/purchasedata.purchasestate)中一个。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| int          | <p><br></p> |

### getRecurringState <a href="#id-cn-purchasedata-getrecurringstate" id="id-cn-purchasedata-getrecurringstate"></a>

`int getRecurringState()`

作为显示包月型商品状态的值，返回[PurchaseData.RecurringState](../annotations/purchasedata.recurringstate)中一个。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| int          | <p><br></p> |

### getQuantity <a href="#id-cn-purchasedata-getquantity" id="id-cn-purchasedata-getquantity"></a>

`int getQuantity()`

返回商品的数量。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| int          | <p><br></p> |

### getSignature <a href="#id-cn-purchasedata-getsignature" id="id-cn-purchasedata-getsignature"></a>

`String getSignature()`

返回包含开发公司个人密钥签名的购买数据签名的字符串 。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getOriginalJson <a href="#id-cn-purchasedata-getoriginaljson" id="id-cn-purchasedata-getoriginaljson"></a>

`String getOriginalJson()`

返回包含购买数据详细信息的JSON 格式字符串。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |
