Beispiel #1
0
        public ActionResult Paypal(decimal amount)
        {
            var r = PaypalUtil.Request(DateTime.Now.ToString("yyyyMMddHHmmss"), amount);

            TempData["payment-" + r.OrderId] = r.PaymentId;
            if (r.Success)
            {
                return(Redirect(r.Redirect));
            }

            ViewBag.Message = r.ErrorMessage;

            return(View());
        }
Beispiel #2
0
        public ActionResult Notify_Paypal()
        {
            var q         = Request.QueryString;
            var paymentId = (string)TempData["payment-" + q["orderId"]];

            if (PaypalUtil.Verify(q, paymentId))
            {
                ViewBag.Message = "Success";
            }
            else
            {
                ViewBag.Message = "Fail";
            }
            return(View("Notify"));
        }