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); }
public static string getMerchantTntRef(TxnRefType txnRefType, string OrderID, string bank, string account) { string strTemp = txnRefType.ToString() + "/" + bank + "/" + account + "/" + DateTime.Now.ToString("hhmmss"); return(strTemp); }