public GetStoreProductResponse GetStoreProduct(Guid storeID, Guid productID) { // if need must be configured correctly GetStoreProductResponse response = new GetStoreProductResponse(); try { StoreProduct storeProduct = new StoreProduct(); StoreProductView storeProductView = storeProduct.ConvertToStoreProductView(); storeProduct = _storeProductRepository.FindBy(storeID, productID); if (storeProduct != null) { storeProductView = storeProduct.ConvertToStoreProductView(); } response.StoreProductView = storeProductView; } catch (Exception ex) { throw; } return(response); }
public ActionResult Details(string id, string productID) { StoreProductView storeProductView = this.GetStoreProductView(id, productID); StoreProductDetailView storeProductDetailView = new StoreProductDetailView(); storeProductDetailView.EmployeeView = GetEmployee(); #region Access Check bool hasPermission = GetEmployee().IsGuaranteed("StoreProduct_Read"); if (!hasPermission) { ModelState.AddModelError("", "AccessDenied"); return(View(storeProductView)); } #endregion storeProductDetailView.StoreProductView = storeProductView; return(View(storeProductDetailView)); }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "In-App Purchases", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Init")) { PaymentManagerExample.init(); } if (PaymentManager.Instance.IsStoreLoaded) { GUI.enabled = true; } else { GUI.enabled = false; } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #1")) { PaymentManagerExample.buyItem(PaymentManagerExample.SMALL_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Perform Buy #2")) { PaymentManagerExample.buyItem(PaymentManagerExample.NC_PACK); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Restore Purchases")) { PaymentManager.Instance.RestorePurchases(); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Verify Last Purchases")) { PaymentManager.Instance.VerifyLastPurchase(PaymentManager.SANDBOX_VERIFICATION_SERVER); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Product View")) { StoreProductView view = new StoreProductView("333700869"); view.Dismissed += StoreProductViewDisnissed; view.Load(); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Is Payments Enabled On device")) { IOSNativePopUpManager.showMessage("Payments Settings State", "Is Payments Enabled: " + PaymentManager.Instance.IsInAppPurchasesEnabled); } StartX = XStartPos; StartY += YButtonStep; StartY += YLableStep; GUI.enabled = true; GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Local Receipt Validation", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth + 10, buttonHeight), "Load Receipt")) { ISN_Security.OnReceiptLoaded += OnReceiptLoaded; ISN_Security.Instance.RetrieveLocalReceipt(); } }