diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index a6ef3ea..e4e1213 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -323,6 +323,33 @@ namespace Guru } } + public Product GetProduct(string productName) + { + if (_storeController == null || _storeController.products == null) + { + var info = GetInfo(productName); + if (info != null) + { + return _storeController.products.WithID(info.Id); + } + } + + return null; + } + + /// + /// 当前的商品是否已经持有收据了 + /// + /// + /// + public bool IsProductHasReceipt(string productName) + { + var product = GetProduct(productName); + if (product != null) return product.hasReceipt; + return false; + } + + #endregion #region 订单验证器