From 79217aaaacb84f74d1921ec904f44b5b2f0f923a Mon Sep 17 00:00:00 2001 From: huyufei Date: Fri, 19 Jan 2024 19:00:30 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=98=AF=E5=90=A6=E6=9C=89=E6=94=B6=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GuruIAP/Runtime/Code/IAPServiceBase.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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 订单验证器