Promise <PurchasedProduct> IStore.LaunchPurchaseFlow(Gamer gamer, ProductInfo product) { // Already in progress? Refuse immediately. lock (this) { if (LastLaunchProductPromise != null) { return(Promise <PurchasedProduct> .Rejected(new CotcException(ErrorCode.AlreadyInProgress, "Launching purchase"))); } LastLaunchProductPromise = new Promise <PurchasedProduct>(); } // Will call back the CotcInappPurchaseGameObject JavaClass.CallStatic("launchPurchase", product.ToJson()); return(LastLaunchProductPromise); }
Promise<PurchasedProduct> IStore.LaunchPurchaseFlow(Gamer gamer, ProductInfo product) { // Already in progress? Refuse immediately. lock (this) { if (LastLaunchProductPromise != null) { return Promise<PurchasedProduct>.Rejected(new CotcException(ErrorCode.AlreadyInProgress, "Launching purchase")); } LastLaunchProductPromise = new Promise<PurchasedProduct>(); } // Will call back the CotcInappPurchaseGameObject JavaClass.CallStatic("launchPurchase", product.ToJson()); return LastLaunchProductPromise; }