예제 #1
0
        public static bool verifyReturnUrl(string bank)
        {
            switch (bank)
            {
            case BankDeclare.VietcomBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            // LinhDT
            case BankDeclare.TienPhongBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            case BankDeclare.TechcomBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            case BankDeclare.VietinBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            case BankDeclare.VIBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            case BankDeclare.HDBank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            case BankDeclare.OnePayInternational:
                return(OnePay.verifyOPIUrl() ? true : false);

            case BankDeclare.DongABank:
                return(OnePay.verifyPaymentUrl() ? true : false);

            //case BankDeclare.DongABank:
            //    return false;
            case BankDeclare.Nganluong:
                string transaction_info = HttpContext.Current.Request["transaction_info"].Trim().ToString();
                string order_code       = HttpContext.Current.Request["order_code"].Trim().ToString();
                string price            = HttpContext.Current.Request["price"].Trim().ToString();
                string payment_id       = HttpContext.Current.Request["payment_id"].Trim().ToString();
                string payment_type     = HttpContext.Current.Request["payment_type"].Trim();
                string error_text       = HttpContext.Current.Request["error_text"].Trim();
                string secure_code      = HttpContext.Current.Request["secure_code"].Trim();

                return(NL.verifyPaymentUrl(transaction_info, order_code, price, payment_id, payment_type, error_text, secure_code));   // ? true : false;

            default: return(false);
            }
        }
예제 #2
0
        public static string getRedirect(TxnRefType TxnRefType, string OrderID, decimal Total, decimal TransCost, string bank, string account)
        {
            string redirectURL = "";

            bank = bank.ToLower().Trim();
            Dictionary <string, string> ad = new Dictionary <string, string>();

            ad.Add("card_phone_game", "10000");
            // LinhDT
            if (bank == BankDeclare.OnePayInternational || bank == BankDeclare.VietcomBank || bank == BankDeclare.TienPhongBank || bank == BankDeclare.TechcomBank || bank == BankDeclare.VietinBank || bank == BankDeclare.VIBank || bank == BankDeclare.DongABank || bank == BankDeclare.HDBank || bank == BankDeclare.Eximbank || bank == BankDeclare.Gpbank || bank == BankDeclare.Maritimebank || bank == BankDeclare.Navibank || bank == BankDeclare.Oceanbank || bank == BankDeclare.Pgbank || bank == BankDeclare.Sacombank || bank == BankDeclare.Seabank || bank == BankDeclare.Shb || bank == BankDeclare.Vietabank || bank == BankDeclare.Vpbank || bank == BankDeclare.Agribank || bank == BankDeclare.BIDV || bank == BankDeclare.Seabank || bank == BankDeclare.ACB || bank == BankDeclare.MBank || bank == BankDeclare.NamAbank || bank == BankDeclare.Saigonbank || bank == BankDeclare.ACB)
            {
                BankListInfo banks = BankListManager.SelectConfigProvider(bank);
                switch (banks.Provider)
                {
                case "onepay":
                {
                    if (bank == BankDeclare.VietcomBank || bank == BankDeclare.TienPhongBank || bank == BankDeclare.TechcomBank || bank == BankDeclare.VietinBank || bank == BankDeclare.VIBank || bank == BankDeclare.DongABank || bank == BankDeclare.HDBank || bank == BankDeclare.Eximbank || bank == BankDeclare.Gpbank || bank == BankDeclare.Maritimebank || bank == BankDeclare.Navibank || bank == BankDeclare.Oceanbank || bank == BankDeclare.Pgbank || bank == BankDeclare.Sacombank || bank == BankDeclare.Seabank || bank == BankDeclare.Shb || bank == BankDeclare.Vietabank || bank == BankDeclare.Vpbank || bank == BankDeclare.Agribank || bank == BankDeclare.BIDV || bank == BankDeclare.Seabank || bank == BankDeclare.ACB || bank == BankDeclare.MBank || bank == BankDeclare.NamAbank || bank == BankDeclare.Saigonbank || bank == BankDeclare.ACB)
                    {
                        redirectURL = OnePay.Trans2OnePay(OrderID, Total, bank, getMerchantTntRef(TxnRefType, OrderID, bank, account), BankDeclare.ReWriteBank(bank));
                    }
                    //else if (bank == BankDeclare.Agribank || bank == BankDeclare.BIDV)
                    //{
                    //    BankNet bankNet = new BankNet();
                    //    redirectURL = bankNet.SendOrder(TxnRefType, OrderID, Total, TransCost, bank, account);
                    //}
                    //else if (bank == BankDeclare.OnePayInternational)
                    //// redirectURL = VCB.Trans2OPI(OrderID, Total, bank, getMerchantTntRef(TxnRefType, OrderID, bank, account));
                    //{
                    //    redirectURL = VCB.Trans2OPI(OrderID, Total, bank, getMerchantTntRef(TxnRefType, OrderID, bank, account));
                    //    //redirectURL = NLSmart.VisaCheckout(OrderID, Total.ToString(), bank, "", "Phuong thuc mua hang_" + TxnRefType, "0", "0", "0", Config.GetAppSetting("WebsiteAppPath") + "successvisa.aspx", Config.GetAppSetting("WebsiteAppPath") + "bw/errorpay.html", "Customer_" + account, "*****@*****.**", "mobiphone_visa", "address_visa", ad);
                    //    //redirectURL = FormHelper.FormHelper.GetRedirect(redirectURL);
                    //}
                    break;
                }

                case "nganluong":
                {
                    if (bank == BankDeclare.VietcomBank || bank == BankDeclare.TienPhongBank || bank == BankDeclare.TechcomBank || bank == BankDeclare.VietinBank || bank == BankDeclare.VIBank || bank == BankDeclare.DongABank || bank == BankDeclare.HDBank || bank == BankDeclare.Eximbank || bank == BankDeclare.Gpbank || bank == BankDeclare.Maritimebank || bank == BankDeclare.Navibank || bank == BankDeclare.Oceanbank || bank == BankDeclare.Pgbank || bank == BankDeclare.Sacombank || bank == BankDeclare.Seabank || bank == BankDeclare.Shb || bank == BankDeclare.Vietabank || bank == BankDeclare.Vpbank || bank == BankDeclare.Agribank || bank == BankDeclare.BIDV || bank == BankDeclare.Seabank || bank == BankDeclare.ACB || bank == BankDeclare.MBank || bank == BankDeclare.NamAbank || bank == BankDeclare.Saigonbank || bank == BankDeclare.ACB)
                    {
                        // redirectURL = VCB.Trans2OnePay(OrderID, Total, bank, getMerchantTntRef(TxnRefType, OrderID, bank, account));
                        //insert trans
                        string vpc_TicketNo = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
                        InsertTrans(getMerchantTntRef(TxnRefType, OrderID, bank, account), "Bluewave", OrderID, Total, vpc_TicketNo, bank);
                        //make redirect
                        redirectURL = NLSmart.BankCheckout(OrderID, Util.DecimalObjectToString(Total, true, 0).Replace(".", ""), bank, "",
                                                           "Phuong thuc mua hang_" + TxnRefType, "0", "0", "0",
                                                           Config.GetAppSetting("WebsiteAppPath") + "successful.aspx?type=" + TxnRefType.ToString(), Config.GetAppSetting("WebsiteAppPath") + "Error.aspx", Authentication.DefaultAccount.FullName,
                                                           Authentication.DefaultAccount.Email, Authentication.DefaultAccount.Phone, Authentication.DefaultAccount.Address,
                                                           ad);
                        redirectURL = FormHelper.GetRedirect(redirectURL);
                    }
                    else if (bank == BankDeclare.OnePayInternational)
                    {
                        //insert trans
                        string vpc_TicketNo = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
                        InsertTrans(getMerchantTntRef(TxnRefType, OrderID, bank, account), "Bluewave", OrderID, Total, vpc_TicketNo, bank);
                        //make redirect
                        redirectURL = NLSmart.VisaCheckout(OrderID, Util.DecimalObjectToString(Total, true, 0).Replace(".", ""), bank, "", "Phuong thuc mua hang_" + TxnRefType, "0", "0", "0", Config.GetAppSetting("WebsiteAppPath") + "successvisa.aspx?type=" + TxnRefType.ToString(), Config.GetAppSetting("WebsiteAppPath") + "Error.aspx", Authentication.DefaultAccount.FullName, Authentication.DefaultAccount.Email, Authentication.DefaultAccount.Phone, Authentication.DefaultAccount.Address, ad);
                        redirectURL = FormHelper.GetRedirect(redirectURL);
                    }
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
            else if (bank == BankDeclare.Nganluong)
            {
                Total = Math.Round(Total, 0);
                string tran_info = getMerchantTntRef(TxnRefType, OrderID, bank, account);
                SaveTransNL(OrderID, tran_info, Total);
                redirectURL = NL.buildCheckoutUrl(OrderID, Total.ToString(), tran_info);
            }
            // LinhDT:
            else if (bank == BankDeclare.Baokim)
            {
                Total = Math.Round(Total, 0);
                string tran_info = getMerchantTntRef(TxnRefType, OrderID, bank, account);
                redirectURL = BK.createRequestUrl(OrderID, Total.ToString(), tran_info);
                SaveTransBK(OrderID, tran_info, Total, redirectURL);
            }
            //else if (bankID == "dab")
            //    return "";

            return(redirectURL);
        }