Exemple #1
0
        // reached by the paylink in the confirmation email
        // which is produced in EnrollAndConfirm
        public ActionResult PayAmtDue(string q)
        {
            if (!q.HasValue())
                return Content("unknown");
            var id = Util.Decrypt(q).ToInt2();
            var qq = from t in DbUtil.Db.Transactions
                     where t.OriginalId == id || t.Id == id
                     orderby t.Id descending
                     select t;
            var ti = qq.FirstOrDefault();

            if (ti == null || ti.Amtdue == 0)
                return Content("no outstanding transaction");

            #if DEBUG
            ti.Testing = true;
            if (!ti.Address.HasValue())
            {
                ti.Address = "235 Riveredge";
                ti.City = "Cordova";
                ti.Zip = "38018";
                ti.State = "TN";
            }
            #endif
            var pf = PaymentForm.CreatePaymentFormForBalanceDue(ti);

            SetHeaders(pf.OrgId ?? 0);

            if (OnlineRegModel.GetTransactionGateway() != "serviceu")
                return View("Payment/Process", pf);

            ViewBag.TranId = ti.Id;
            var pm = new PaymentModel
            {
                NameOnAccount = pf.FullName(),
                Address = pf.Address,
                Amount = pf.Amtdue,
                City = pf.City,
                Email = pf.Email,
                Phone = pf.Phone.FmtFone(),
                State = pf.State,
                PostalCode = pf.Zip,
                testing = pf.testing,
                PostbackURL = DbUtil.Db.ServerLink("/OnlineReg/ConfirmServiceU/" + id),
                Misc2 = pf.Description,
                Misc1 = pf.FullName(),
                _URL = pf.URL,
                _timeout = new PaymentForm().TimeOut,
            };

            return View("PayAmtDue/ServiceU", pm);
        }
Exemple #2
0
        public ActionResult PayDue(string q)
        {
            if (!q.HasValue())
                return Content("unknown");
            var id = Util.Decrypt(q);
            var ed = DbUtil.Db.ExtraDatas.SingleOrDefault(e => e.Id == id.ToInt());
            if (ed == null)
                return Content("no outstanding transaction");
            PaymentModel pm = null;
            try
            {
                var s = ed.Data.Replace("CMSWeb.Models", "CmsWeb.Models");
                var ti = Util.DeSerialize<TransactionInfo>(s);
                pm = new PaymentModel
                {
                    NameOnAccount = ti.Name,
                    Address = ti.Address,
                    Amount = ti.AmountDue,
                    City = ti.City,
                    Email = ti.Email,
                    Phone = ti.Phone.FmtFone(),
                    State = ti.State,
                    PostalCode = ti.Zip,
                    testing = ti.testing,
                    PostbackURL = Util.ServerLink("/OnlineReg/Confirm2/" + id),
                    Misc2 = ti.Header,
                    Misc1 = ti.Name,
                    _URL = ti.URL,
                    _timeout = INT_timeout,
                    _datumid = ed.Id,
                };

                SetHeaders(ti.orgid);
                return View("Payment2", pm);
            }
            catch (Exception ex)
            {
                throw new Exception("Problem in PayDue: " + ed.Data, ex);
            }
        }