To check in-app purchase to the Myket server and ensure their status and avoid intruder fraud, you need to connect to the Server via your server. You should call the following service:
[GET] [Header: X-Access-Token] https://developer.myket.ir/api/applications/{PAKCAGE_NAME}/purchases/products/{SKU_ID}/tokens/{TOKEN}
Authentication
To use this service, you must get the X-Access-Token key from the Setting menu in your Myket Developer’s panel (Console) and set it as a header in your service. for example:
X-Access-Token: 650e0714-a4348-v475-a40-3f3ec5fcf001
Request
The following parameters should be replaced with the appropriate values:
- The parameter {PACKAGE_NAME} is the same as the package name of your app. For example, com.supercell.clashofclans
- The parameter {SKU_ID} is the same as your in-app product id (SKU_ID). For example, GEM2
- The {TOKEN} parameter is your purchase Token. For example, 092181
Response
If the operation is successful, the following information will be returned to you:
- The ‘purchaseState’ specifies the success of your purchase. 0 means successful purchase and 1 means an unsuccessful purchase.
- The ‘purchaseTime’ is an in-app purchase transaction time. This time is based on TimeStamp (see http://www.epochconverter.comfor information).
- The ‘kind’ specifies the purchase type, For example, androidpublisher#productPurchase
- The ‘developerPayload’ is a string that has been sent to Myket at the in-app purchase time.
- The ‘consumptionState’ is related to the product consume. By default, this field is 0 And will be 0 for non-consumable products (such as removing ads). And it is equal to 1 for consumable products (such as coins or diamonds), which indicates that the product has been consumed.
Sample Response
As an example, the output will be as follows:
{ "kind": "androidpublisher#productPurchase", "purchaseTime": 1492839267000, "developerPayload": "", "purchaseState": 0, "consumptionState": 1 }