Exemple #1
0
        private void DangKyBaoKim(int madangky)
        {
            var           user           = kiemtra.getUser(User.Identity.Name);
            int           LoaiGianHangId = madangky;
            var           loai           = db.LoaiGianHangs.Find(LoaiGianHangId);
            BaoKimPayment bk             = new BaoKimPayment();
            string        description    = "Gói dịch vụ đăng ký, số tiền " + loai.Price.ToString("#,##0").Replace(",", ".") + " đồng của chúng tôi";
            string        url_success    = "http://qlbh.azurewebsites.net/Account/DangKyBaoKimThanhCong?madangky=" + madangky + "&username="******"http://qlbh.azurewebsites.net/Account/Error";
            var           url            = bk.createRequestUrl(user.UserName, "*****@*****.**", loai.Price + "", description, url_success, url_error);

            Redirect(url);
        }
 protected void Baokim_Paymnet_click(object sender, EventArgs e)
 {
     var bk = new BaoKimPayment();
     String order_id = DateTime.Now.ToLongDateString();//mã đơn hàng
     String business= SessionKey.Business;//email bảo kim nhận tiền
     String total_amount=tbxMoney.Text;
     String shipping_fee="";//phí vận chuyển
     String tax_fee="";//thuế khác
     String order_description="";//mo ta đơn hàng
     String url_success = "";//url trả về khi thanh toán thành công
     String url_cancel = "";//url trả về khi thanh toán thất bại
     String url_detail="";
     Response.Redirect(bk.createRequestUrl(order_id, business, total_amount, shipping_fee, tax_fee, order_description, url_success, url_cancel, url_detail));
 }
Exemple #3
0
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     if (Session["TenDN"] != null)
     {
         BaoKimPayment bk = new BaoKimPayment();
         thanhtoan = 1;
         LuuThanhToan();
         string   sodh      = XLDL.LayDuLieu("select max(sodh) from donhang where makh=" + XLDL.LayDuLieu("select makh from khachhang where tendn='" + XLDL.MaHoa(Session["TenDN"].ToString()) + "'").Rows[0][0]).Rows[0][0].ToString();
         string   str       = lbTongCong.Text;
         string[] a         = str.Split(' ');
         double   thanhtien = Convert.ToDouble(a[2].Substring(0, a[2].Length - 1));
         string   chuoibk   = bk.createRequestUrl(sodh, SessionKey.Business, Convert.ToString(thanhtien), "0", "0", mota, "http://nguyenhoang.ga/thanhcong.aspx", "http://nguyenhoang.ga/thanhcong.aspx", "");
         Session["MHtoTC"]  = true;
         Session["Giohang"] = null;
         Response.Redirect(chuoibk);
     }
 }
        public ActionResult Baokim(ProjectBackDTO backingData)
        {
            try
            {
                var bk = new BaoKimPayment();
                var randomCode = CommonUtils.GenerateVerifyCode().Substring(0, 10);
                string totalPledge = backingData.PledgeAmount.ToString();
                var paymentUrl = bk.createRequestUrl(
                    int.Parse(backingData.ProjectCode.Substring(3,6)) + randomCode + DateTime.Now.ToString("hmmsstt"),
                    "*****@*****.**",
                     totalPledge,
                    "0",
                    "0",
                    backingData.RewardPkgDesc,
                    "http://dandelionvn.com/baokimcallback",
                    "http://dandelionvn.com/#/project/detail/" + Request.QueryString["ProjectCode"],
                    "http://dandelionvn.com/#/project/detail/" + Request.QueryString["ProjectCode"]
                    );

                // Inital cookie
                HttpCookie projectCodeCookie = new HttpCookie("ProjectCode");
                HttpCookie emailCookie = new HttpCookie("Email");
                HttpCookie backerNameCookie = new HttpCookie("BackerName");
                HttpCookie rewardIdCookie = new HttpCookie("RewardId");
                HttpCookie pledgeAmountCookie = new HttpCookie("PledgeAmount");
                HttpCookie quantityCookie = new HttpCookie("Quantity");
                HttpCookie descCookie = new HttpCookie("description");
                HttpCookie addressCookie = new HttpCookie("Address");
                HttpCookie phoneNumberCookie = new HttpCookie("Phonenumber");

                DateTime now = DateTime.Now;

                // Set the cookie value.
                projectCodeCookie.Value = backingData.ProjectCode;
                emailCookie.Value = backingData.Email;
                backerNameCookie.Value = HttpUtility.UrlEncode(backingData.BackerName);
                rewardIdCookie.Value = backingData.RewardPkgID.ToString();
                pledgeAmountCookie.Value = backingData.PledgeAmount.ToString();
                quantityCookie.Value = backingData.Quantity.ToString();
                descCookie.Value = HttpUtility.UrlEncode(backingData.Description);
                addressCookie.Value = HttpUtility.UrlEncode(backingData.Address);
                phoneNumberCookie.Value = backingData.PhoneNumber;

                // Set the cookie expiration date.
                projectCodeCookie.Expires = now.AddMinutes(30);
                emailCookie.Expires = now.AddMinutes(30);
                backerNameCookie.Expires = now.AddMinutes(30);
                rewardIdCookie.Expires = now.AddMinutes(30);
                pledgeAmountCookie.Expires = now.AddMinutes(30);
                quantityCookie.Expires = now.AddMinutes(30);
                descCookie.Expires = now.AddMinutes(30);
                addressCookie.Expires = now.AddMinutes(30);
                phoneNumberCookie.Expires = now.AddMinutes(30);

                // Add the cookie.
                Response.Cookies.Add(projectCodeCookie);
                Response.Cookies.Add(emailCookie);
                Response.Cookies.Add(backerNameCookie);
                Response.Cookies.Add(rewardIdCookie);
                Response.Cookies.Add(pledgeAmountCookie);
                Response.Cookies.Add(quantityCookie);
                Response.Cookies.Add(descCookie);
                Response.Cookies.Add(addressCookie);
                Response.Cookies.Add(phoneNumberCookie);

                return Redirect(paymentUrl);
            }
            catch (Exception)
            {
                return Redirect("/#/error");
            }
        }
        public ActionResult Baokim()
        {
            try
            {
                var bk = new BaoKimPayment();
                var randomCode = CommonUtils.GenerateVerifyCode();
                var paymentUrl = bk.createRequestUrl(
                    Request.QueryString["ProjectCode"] + randomCode + DateTime.Now.ToString("hmmsstt"),
                    "*****@*****.**",
                     Request.QueryString["PledgeAmount"],
                    "0",
                    "0",
                    Request.QueryString["Des"],
                    "http://dandelionvn.com/baokimcallback",
                    "http://dandelionvn.com/#/project/detail/" + Request.QueryString["ProjectCode"],
                    "http://dandelionvn.com/#/project/detail/" + Request.QueryString["ProjectCode"]
                    );

                // Inital cookie
                HttpCookie projectCodeCookie = new HttpCookie("ProjectCode");
                HttpCookie emailCookie = new HttpCookie("Email");
                HttpCookie backerNameCookie = new HttpCookie("BackerName");
                HttpCookie rewardIdCookie = new HttpCookie("RewardId");
                HttpCookie pledgeAmountCookie = new HttpCookie("PledgeAmount");
                HttpCookie quantityCookie = new HttpCookie("Quantity");
                HttpCookie descCookie = new HttpCookie("description");
                HttpCookie addressCookie = new HttpCookie("Address");
                HttpCookie phoneNumberCookie = new HttpCookie("Phonenumber");

                DateTime now = DateTime.Now;

                // Set the cookie value.
                projectCodeCookie.Value = Request.QueryString["ProjectCode"];
                emailCookie.Value = Request.QueryString["Email"];
                backerNameCookie.Value = HttpUtility.UrlDecode(Request.QueryString["BackerName"]);
                rewardIdCookie.Value = Request.QueryString["RewardId"];
                pledgeAmountCookie.Value = Request.QueryString["PledgeAmount"];
                quantityCookie.Value = Request.QueryString["Quantity"];
                descCookie.Value = HttpUtility.UrlDecode(Request.QueryString["Mes"]);
                addressCookie.Value = HttpUtility.UrlDecode(Request.QueryString["Address"]);
                phoneNumberCookie.Value = Request.QueryString["Phone"];

                // Set the cookie expiration date.
                projectCodeCookie.Expires = now.AddMinutes(30);
                emailCookie.Expires = now.AddMinutes(30);
                backerNameCookie.Expires = now.AddMinutes(30);
                rewardIdCookie.Expires = now.AddMinutes(30);
                pledgeAmountCookie.Expires = now.AddMinutes(30);
                quantityCookie.Expires = now.AddMinutes(30);
                descCookie.Expires = now.AddMinutes(30);
                addressCookie.Expires = now.AddMinutes(30);
                phoneNumberCookie.Expires = now.AddMinutes(30);

                // Add the cookie.
                Response.Cookies.Add(projectCodeCookie);
                Response.Cookies.Add(emailCookie);
                Response.Cookies.Add(backerNameCookie);
                Response.Cookies.Add(rewardIdCookie);
                Response.Cookies.Add(pledgeAmountCookie);
                Response.Cookies.Add(quantityCookie);
                Response.Cookies.Add(descCookie);
                Response.Cookies.Add(addressCookie);
                Response.Cookies.Add(phoneNumberCookie);

                return Redirect(paymentUrl);
            }
            catch (Exception)
            {
                return Redirect("/#/error");
            }
        }