# PurchaseData

public class PurchaseData extends Object\
java.lang.Object    ↳ com.gaa.sdk.iap.PurchaseData

\
Indicates the purchase data of in-app's purchases.

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

***

| **Nested classes** |                                                                                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| @interface         | [PurchaseData.AcknowledgeState](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/annptations/purchasedata.acknowledgestate) |
| @interface         | [PurchaseData.PurchaseState](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/annptations/purchasedata.purchasestate)       |
| @interface         | [PurchaseData.RecurringState](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/annptations/purchasedata.recurringstate)     |

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

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

***

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

String getOrderId()\
Restores the order ID of purchases.

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

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

String getPackageName()\
Restores the package name of the application that started to purchase.

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

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

String getProductId()\
Restores the ID of purchased in-app products.

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

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

long getPurchaseTime()\
Restores the purchased time of in-app products to unit in seconds.

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

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

boolean isAcknowledged()\
Indicates whether the purchase is acknowledged.

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

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

String getDeveloperPayload()\
Delivers the payload of the developer that was specified when the purchase was acknowledged or consumed.

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

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

@DeprecatedString getPurchaseId()\
Restores the ID that distinguishes the purchased data uniquely (not used in API v6).

| **Returns:**       |             |
| ------------------ | ----------- |
| String             | <p><br></p> |
| **See Also:**      |             |
| getPurchaseToken() | <p><br></p> |

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

String getPurchaseToken()\
Restores the token that distinguishes the purchased data uniquely.

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

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

int getPurchaseState()\
Restores the one of [PurchaseData.PurchaseState](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/annptations/purchasedata.purchasestate) as indicating the value of the purchased state.

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

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

int getRecurringState()\
Restores the one of [PurchaseData.RecurringState](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/references/annptations/purchasedata.recurringstate) as indicating the value of the monthly auto-renewal state.

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

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

int getQuantity()\
Restores the quantity of the products.

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

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

String getSignature()\
Restores the string which includes the signature of the purchased data signed by the personal key of the developer.

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

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

String getOriginalJson()\
Restores the JSON formatted string which includes detailed information of the purchased data.

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