예제 #1
0
        /// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns>returns ActionResult</returns>
        public ActionResult Index()
        {
            ReceiptTestViewModel model = new ReceiptTestViewModel();

            model.Environment = "production";
            return(this.View(model));
        }
예제 #2
0
        public ActionResult Index(ReceiptTestViewModel model)
        {
            ReceiptManager receiptManager = new ReceiptManager();
            var            env            = AppleReceiptVerifier.Environments.Production;

            if (model.Environment == "sandbox")
            {
                env = AppleReceiptVerifier.Environments.Sandbox;
            }

            var response = receiptManager.ValidateReceipt(env, model.ReceiptData, model.Password);

            model.ReceiptResponse = response;

            return(this.View(model));
        }