# PurchaseData

```
public class PurchaseData extends Object
```

```
java.lang.Object
    ↳ com.gaa.sdk.iap.PurchaseData
```

<br>

It shows the purchase data of in-app purchases (IAP).

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

***

| Nested classes |                                                                                                                    |
| -------------- | ------------------------------------------------------------------------------------------------------------------ |
| @interface     | [PurchaseData.AcknowledgeState](https://dev.onestore.co.kr/wiki/en/doc/purchasedata-acknowledgestate-5833454.html) |
| @interface     | [PurchaseData.PurchaseState](https://dev.onestore.co.kr/wiki/en/doc/purchasedata-purchasestate-5833455.html)       |
| @interface     | [PurchaseData.RecurringState](https://dev.onestore.co.kr/wiki/en/doc/purchasedata-recurringstate-5833445.html)     |

<table><thead><tr><th>Public constructors</th></tr></thead><tbody><tr><td><pre><code>PurchaseData(String jsonPurchaseData)
</code></pre></td></tr><tr><td><pre><code>PurchaseData(String jsonPurchaseData, String signature)
</code></pre></td></tr></tbody></table>

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

***

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

```
String getOrderId()
```

It returns the order ID for purchase.

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

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

```
String getPackageName()
```

It returns the packageName of application, which initiates purchase.

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

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

```
String getProductId()
```

It returns the ID of purchased in-app products.

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

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

```
long getPurchaseTime()
```

It returns the in-app purchase time in the unit of milliseconds.

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

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

```
boolean isAcknowledged()
```

It shows whether purchase is acknowledged or not.

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

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

```
String getDeveloperPayload()
```

It forwards the developer’s payload specified when acknowledging or consuming purchase.

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

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

```
@Deprecated
String getPurchaseId()
```

It returns the ID uniquely identifying purchased data.

It is not used for API v6.

<table data-header-hidden><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Returns:</strong></td><td></td></tr><tr><td>String</td><td><br></td></tr><tr><td><strong>See Also:</strong></td><td></td></tr><tr><td><pre><code>getPurchaseToken()
</code></pre></td><td></td></tr></tbody></table>

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

```
String getPurchaseToken()
```

It returns the token uniquely identifying purchased data.

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

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

```
int getPurchaseState()
```

It returns one of the [PurchaseData.PurchaseState](https://wiki.onestorecorp.com/display/IAPGOOGLE/PurchaseData.PurchaseState) as a value indicating purchase status.

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

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

```
int getRecurringState()
```

It returns one of the [PurchaseData.RecurringState](https://wiki.onestorecorp.com/display/IAPGOOGLE/PurchaseData.RecurringState) as a value indicating Monthly auto-renewal product status.

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

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

```
String getSignature()
```

It returns a string containing the signature of the purchase data signed with the developer’s private key.

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

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

```
String getOriginalJson()
```

It returns a string in json format containing purchase data details.

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


---

# Agent Instructions: 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:

```
GET https://onestore-dev.gitbook.io/dev/eng/tools/billing/old-version/v19/one-store-iap-reference/classes/purchasedata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
