> For the complete documentation index, see [llms.txt](https://onestore-dev.gitbook.io/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onestore-dev.gitbook.io/dev/chi/tools/billing/v21/references/classes/purchasedata.md).

# 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="/pages/fDHMpgtci81cg2RI5CYB">PurchaseData.AcknowledgeState</a></td></tr><tr><td>@interface</td><td><a href="/pages/l0H5EN60J7DEw8Y1ubpH">PurchaseData.PurchaseState</a></td></tr><tr><td>@interface</td><td><a href="/pages/gAVFIxDj3Gw3h26X5V65">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](/dev/chi/tools/billing/v21/references/annotations/purchasedata.purchasestate.md)中一个。

| **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](/dev/chi/tools/billing/v21/references/annotations/purchasedata.recurringstate.md)中一个。

| **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> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/chi/tools/billing/v21/references/classes/purchasedata.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
