Android Receipt Validation - Unity IAP
Validates Android client's in-app purchase receipts. This code is specifically for Unity IAP.
Source Code
var result = pluginIap.unityAndroidValidate({
version : "v20220801",
parameters : {
receipt : "RECEIPT"
}
});
if(result.statusCode == 200) {
log.debug(result.body.toString());
log.debug("success");
} else {
log.debug("fail");
}
Request Parameter
| Parameter | Description | Type |
|---|---|---|
| receipt | Receipt information | string |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"UserID" : "String",
"PackageName" : "String",
"OrderID" : "String",
"ProductID" : "String",
"Currency" : "String",
"Price" : "String",
"Quantity" : "Integer"
}
Response Details
| Data Key | Description | Type |
|---|---|---|
| UserID | Processing result | string |
| PackageName | App package name | string |
| ProductID | Payment product ID | string |
| OrderID | Order ID | string |
| Currency | Payment currency code | string |
| Price | Payment product price | string |
| Quantity | Purchase quantity | integer |