예제 #1
0
        public ActionResult DetailView(Guid Id)
        {
            Session.Remove(Constants.TransactionDiscountAttach);
            var decryptVariables = Extentions.DecryptVariables(Id);

            return(View(decryptVariables));
        }
예제 #2
0
        public ActionResult View(Guid Id)
        {
            var decryptVariables = Extentions.DecryptVariables(Id);

            GetValue(decryptVariables);
            return(View(decryptVariables));
        }
예제 #3
0
        public ActionResult View(Guid Id, FormCollection collection)
        {
            var decryptVariables = Extentions.DecryptVariables(Id);

            try
            {
                var tr = new Transaction();
                this.RadynTryUpdateModel(tr, collection);
                tr.PayTypeId = (byte)collection["PayTypeId"].ToEnum <Enums.PayType>();
                if (!string.IsNullOrEmpty(collection["PayDate"]))
                {
                    tr.PayDate = DateTime.Parse(DateTimeUtil.ShamsiDateToGregorianDate(collection["PayDate"]).ToString("yyyy-MM-dd ") + collection["PayTime"]);
                }
                HttpPostedFileBase DocScanId = null;
                if (Session["DocScanId"] != null)
                {
                    DocScanId = (HttpPostedFileBase)Session["DocScanId"];
                    Session.Remove("DocScanId");
                }
                if (tr.PayTypeId.Equals((byte)Enums.PayType.Documnet))
                {
                    var documnetPay = PaymentComponenets.Instance.TransactionFacade.DocumnetPay(decryptVariables.Id, tr, DocScanId);
                    if (documnetPay != null)
                    {
                        ShowMessage(Resources.Payment.PaySuccessful, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Succeed);
                        return(Redirect("~" + documnetPay.CallBackUrl));
                    }
                    ShowMessage(Resources.Common.ErrorInInsert, Resources.Common.MessaageTitle, messageIcon: MessageIcon.Error);
                    return(View(decryptVariables));
                }
                if (string.IsNullOrEmpty(collection["bankId"]))
                {
                    ShowMessage(Resources.Payment.PleaseSelectBank, Resources.Common.MessaageTitle,
                                messageIcon: MessageIcon.Error);
                    return(View(decryptVariables));
                }
                tr.OnlineBankId = (Byte)collection["bankId"].ToEnum <Radyn.PaymentGateway.Tools.Enums.Bank>();
                string withGateway;
                if (string.IsNullOrEmpty(decryptVariables.TerminalId))
                {
                    withGateway =
                        Radyn.PaymentGateway.PaymentGatewayComponenets.Instance.GeneralFacade.OnlinePay(
                            decryptVariables.Id, tr, Request.Url.Authority + Radyn.Web.Mvc.UI.Application.CurrentApplicationPath);
                }
                else
                {
                    withGateway =
                        Radyn.PaymentGateway.PaymentGatewayComponenets.Instance.GeneralFacade.OnlinePay(
                            decryptVariables.Id, tr, Request.Url.Authority + Radyn.Web.Mvc.UI.Application.CurrentApplicationPath,
                            decryptVariables.MerchantId, decryptVariables.TerminalId, decryptVariables.TerminalUserName, decryptVariables.TerminalPassword, decryptVariables.CertificatePath, decryptVariables.CertificatePassword, decryptVariables.MerchantPublicKey, decryptVariables.MerchantPrivateKey);
                }
                return(Redirect(withGateway));
            }
            catch (Exception exception)
            {
                ShowExceptionMessage(exception);
                return(View(decryptVariables));
            }
        }
예제 #4
0
 public ActionResult CallBackToRef(Guid id)
 {
     try
     {
         var decryptVariables = Extentions.DecryptVariables(id);
         var tr = new Transaction {
             PayDate = decryptVariables.Date
         };
         var addTransaction = PaymentComponenets.Instance.TransactionFacade.UpdateTempAndAddTransaction(decryptVariables.Id, tr, 0);
         return(addTransaction != null?Redirect("~" + decryptVariables.CallBackUrl) : Redirect("~/Payment/Transaction/DetailView?value=" + id));
     }
     catch (Exception exception)
     {
         ShowExceptionMessage(exception);
         return(Redirect("~/Payment/Transaction/DetailView?value=" + id));
     }
 }