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()); }
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")); }