GooglePlayReceipt google = productReceipt as GooglePlayReceipt;
Debug.Log (Convert.ToString(google.purchaseState));
When validating purchases from players, I get purchaseState == 4, although in the code I see an enum GooglePurchaseState that only has three (0, 1, 2) states.
public enum GooglePurchaseState
{
Purchased,
Cancelled,
Refunded
}
where did state number 4 come from? This is definitely a cheat purchase, the player somehow learned to call ProcessPurchase() when the application restarts and he successfully passes the validation many times with *purchaseState==*4
Unity 2020.3.15, IAP 3.2.3, Android
@MaximPP Google hasn’t updated the enum documentation. It’s a new purchase option from Google referred to as a Pending or Deferred purchase. It is a valid state, and not a cheat. The user will purchase the in app product in the game then has 3 days to pay at a physical location approved by Google. If they don’t pay, the transaction is cancelled. Until they pay, purchaseState = 4, and you should continue to return Pending from ProcessPurchase. Once they pay, purchaseState = 1 and you award the product and return Complete from ProcessPurchase. This code demonstrates a good technique to get the value Google Play IAP Problem - #8 by bardia68
3 Likes
Thank you for the clarification