Пример #1
0
        public ActionResult PaymentResponse(
            String VERSION, String STAMP, String REFERENCE,
            String PAYMENT, String STATUS, String ALGORITHM, String MAC)
        {
            PaymentResponse paymentResponse = new PaymentResponse();

            paymentResponse.SetValues(merchantSecretKey, Request.Params);

            //if response valid (ok data)
            if (paymentResponse.IsValid())
            {
                ViewBag.PaymentResponseMessage =
                    PaymentUtils.GetPaymentResponseStatusMessage(paymentResponse.Status);
            }
            else //invalid response (corrupt data)
            {
                ViewBag.PaymentResponseMessage = "response invalid";
                return(View("PaymentResponseError"));
            }

            //set form values ready for payment status query
            QueryViewModel queryViewModel = new QueryViewModel();

            queryViewModel.Stamp     = paymentResponse.Stamp;
            queryViewModel.Reference = paymentResponse.Reference;
            //Get Amount from Session, because it's not available
            //from PaymentResponse (for testing).
            queryViewModel.Amount = (string)Session["Amount"];

            return(View(queryViewModel));
        }