static Config() { //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ //合作身份者ID,以2088开头由16位纯数字组成的字符串 partner = "2088701020787394"; //交易安全检验码,由数字和字母组成的32位字符串 key = "gubdqhtq0a2fjzvo3x7d8wwa8d9gzjvd"; //签约支付宝账号或卖家支付宝帐户 seller_email = "*****@*****.**"; string sRootUrl = ProvideCommon.GetRootURI(); //页面跳转同步返回页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数 return_url = string.Format("{0}/Pay/PayAli_Return.aspx", sRootUrl); //服务器通知的页面文件路径 要用 http://格式的完整路径,不允许加?id=123这类自定义参数 notify_url = string.Format("{0}/Pay/PayAli_Notify.aspx", sRootUrl); //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ //字符编码格式 目前支持 gbk 或 utf-8 input_charset = "utf-8"; //签名方式 不需修改 sign_type = "MD5"; //访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http transport = "https"; }
public static string QuickPayBegin(string sOrderID, string sAccount, decimal dPrice, string sGame) { string sprec = string.Format("{0}/Pay/QuickVCallBack.aspx", ProvideCommon.GetRootURI()); //换成商户接收地址 string spcustom = sGame; // 需要 Server.UrlEncode编码 '客户自定义 30字符内 只能是数字、字母或数字字母的组合。不能用汉字。 return(PayDirect(sOrderID, sAccount, dPrice, spcustom, sprec)); }
private const string md5key = "Cptfhb6gH4uzz7XtrkTr"; //商户sp校验密钥 public static string PayDirect(string sOrderID, decimal dPrice, string privateField, string itemName) { string servadd = "https://payinterface.qiandai.com/qdpay/entrance.do"; string interfaceVer = "1.0"; string tradeMoney = dPrice.ToString("f2"); string partnerTradeId = sOrderID.Substring(0, 32);//小于等于32位 string childItem = "ccc"; string partnerNo = "1000010706"; string returnUrl = string.Format("{0}/Pay/PayQdb_Return.aspx", ProvideCommon.GetRootURI()); //页面返回地址; string notifyUrl = string.Format("{0}/Pay/PayQdb_Notify.aspx", ProvideCommon.GetRootURI()); //服务器返回地址 string productName = itemName; string productUrl = string.Format("{0}/pay/", ProvideCommon.GetRootURI()); string remark = string.Format("{0}|{1}", sOrderID.Substring(32), privateField); string bankCode = "cnUpop"; string signType = "1"; string userIp = ProvideCommon.GetRealIP(); string tradeFailureTime = "10"; string place = "externalMerchant"; string orderTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string isDirect = "1"; string phone = "1"; string email = "*****@*****.**"; //组织验签数据 string signStr = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}", interfaceVer, tradeMoney, partnerTradeId, partnerNo, returnUrl, notifyUrl, productName, productUrl, remark, bankCode, signType, userIp, tradeFailureTime, place, orderTime, md5key); //验签数据加密 string sign = GetMD5(signStr, "gb2312"); StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("<form id='qdbpaysubmit' name='qdbpaysubmit' action='{0}' method='post'>", servadd); sbText.AppendFormat("<input type='hidden' name='interfaceVer' value='{0}'/>", interfaceVer); sbText.AppendFormat("<input type='hidden' name='tradeMoney' value='{0}'/>", tradeMoney); sbText.AppendFormat("<input type='hidden' name='partnerTradeId' value='{0}'/>", partnerTradeId); sbText.AppendFormat("<input type='hidden' name='partnerNo' value='{0}'/>", partnerNo); sbText.AppendFormat("<input type='hidden' name='childItem' value='{0}'/>", childItem); sbText.AppendFormat("<input type='hidden' name='returnUrl' value='{0}'/>", returnUrl); sbText.AppendFormat("<input type='hidden' name='notifyUrl' value='{0}'/>", notifyUrl); sbText.AppendFormat("<input type='hidden' name='productName' value='{0}'/>", productName); sbText.AppendFormat("<input type='hidden' name='productUrl' value='{0}'/>", productUrl); sbText.AppendFormat("<input type='hidden' name='remark' value='{0}'/>", remark); sbText.AppendFormat("<input type='hidden' name='bankCode' value='{0}'/>", bankCode); sbText.AppendFormat("<input type='hidden' name='signType' value='{0}'/>", signType); sbText.AppendFormat("<input type='hidden' name='userIp' value='{0}'/>", userIp); sbText.AppendFormat("<input type='hidden' name='tradeFailureTime' value='{0}'/>", tradeFailureTime); sbText.AppendFormat("<input type='hidden' name='place' value='{0}'/>", place); sbText.AppendFormat("<input type='hidden' name='orderTime' value='{0}'/>", orderTime); sbText.AppendFormat("<input type='hidden' name='sign' value='{0}'/>", sign); sbText.AppendFormat("<input type='hidden' name='isDirect' value='{0}'/>", isDirect); sbText.AppendFormat("<input type='hidden' name='phone' value='{0}'/>", phone); sbText.AppendFormat("<input type='hidden' name='email' value='{0}'/>", email); //submit按钮控件请不要含有name属性 sbText.Append("<input type='submit' value='submit' style='display:none;'></form>"); sbText.Append("<script>document.forms['qdbpaysubmit'].submit();</script>"); FirstOfPayPointBLL.Add(sOrderID, userIp, sbText.ToString()); return(sbText.ToString()); }
public static string PayBegin(string sChannel, string sPhone, string sAccount, decimal dPrice, int iCount) { string sprec = string.Format("{0}/Pay/VCallBack.aspx", ProvideCommon.GetRootURI()); //换成商户接收地址 string spcustom = "wlb"; //需要 Server.UrlEncode编码 '客户自定义 30字符内 只能是数字、字母或数字字母的组合。不能用汉字。 string sTranIP = ProvideCommon.GetRealIP(); string sOrderID = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP); //定单号; return(PayDirect(sOrderID, sAccount, dPrice, spcustom, sprec)); }
public static string PayBegin(string sChannel, string sPhone, string sAccount, decimal dPrice, int iCount, HttpContext Context) { string return_url = string.Format("{0}/pay/TenCallBack.aspx", ProvideCommon.GetRootURI()); string sTranIP = ProvideCommon.GetRealIP(); string sOrderID = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP); string sPayType = "wlb"; return(PayDirect(sOrderID, sAccount, dPrice, sPayType, Context, return_url)); }
public static string PayBegin(string sChannel, string sPhone, string sAccount, decimal dPrice, int iCount) { string sTranIP = ProvideCommon.GetRealIP(); string p2_Order = TransPBLL.PointSalesInit(sChannel, sPhone, sAccount, dPrice, iCount, sTranIP);//订单号 string sPoints = (dPrice * 10).ToString(); StringBuilder sbText = new StringBuilder(); sbText.Append("到武林"); sbText.Append(sPoints); sbText.Append("武林币"); string p5_Pid = sbText.ToString(); //商品名称 string pd_FrpID = string.Empty; //充值方式编码 switch (sChannel) { case "yp-szx": pd_FrpID = "SZX-NET"; break; case "yp-dx": pd_FrpID = "TELECOM-NET"; break; case "yp-lt": pd_FrpID = "UNICOM-NET"; break; case "yp-zt": pd_FrpID = "ZHENGTU-NET"; break; case "yp-sd": pd_FrpID = "SNDACARD-NET"; break; case "yp-jcard": pd_FrpID = "JUNNET-NET"; break; case "yp-bank": pd_FrpID = ""; break; } string pa_MP = sAccount; string p8_Url = string.Format("{0}/pay/YeeCallback.aspx", ProvideCommon.GetRootURI()); string sTranUrl = YeePayBuy.CreateBuyUrl(p2_Order, dPrice.ToString(), sPoints, pa_MP, pd_FrpID, p8_Url); FirstOfPayPointBLL.Add(p2_Order, sTranIP, sTranUrl); return(sTranUrl); }
private const string sppwd = "826672265045182445"; //商户sp校验密钥 public static string PayDirect(string sOrderID, string sAccount, decimal dPrice, string spcustom, string sprec) { string servadd = "http://s3.vnetone.com/Default.aspx"; //v币交易提交地址 string spreq = string.Format("{0}/Pay/", ProvideCommon.GetRootURI()); //换成商户请求地址 string spname = HttpUtility.UrlEncode("到武林平台"); string userip = ProvideCommon.GetRealIP(); string spoid = sOrderID.Substring(0, 30); string snpcustom = HttpUtility.UrlEncode(string.Format("{0}|{1}", sOrderID.Substring(30), spcustom)); string spversion = "vpay1001"; // '此接口的版本号码 此版本是"vpay1001" string urlcode = "utf-8"; //'编码 gbk gb2312 utf-8 unicode big5(注意不能一个繁体和简体字交叉写) 你程序的编码 string money = dPrice.ToString(); string userid = HttpUtility.UrlEncode(sAccount); StringBuilder sbText = new StringBuilder(); sbText.Append(spoid); sbText.Append(spreq); sbText.Append(sprec); sbText.Append(spid); sbText.Append(sppwd); sbText.Append(spversion); sbText.Append(money); string post_key = sbText.ToString(); string spmd5 = ProvideCommon.MD5(post_key).ToUpper();// '先MD532 然后转大写 sbText.Remove(0, sbText.Length); sbText.AppendFormat("<form id='vpaysubmit' name='vpaysubmit' action='{0}' method='post'>", servadd); sbText.AppendFormat("<input type='hidden' name='spid' value='{0}'/>", spid); sbText.AppendFormat("<input type='hidden' name='spname' value='{0}'/>", spname); sbText.AppendFormat("<input type='hidden' name='spoid' value='{0}'/>", spoid); sbText.AppendFormat("<input type='hidden' name='spreq' value='{0}'/>", spreq); sbText.AppendFormat("<input type='hidden' name='sprec' value='{0}'/>", sprec); sbText.AppendFormat("<input type='hidden' name='userid' value='{0}'/>", userid); sbText.AppendFormat("<input type='hidden' name='userip' value='{0}'/>", userip); sbText.AppendFormat("<input type='hidden' name='spmd5' value='{0}'/>", spmd5); sbText.AppendFormat("<input type='hidden' name='spcustom' value='{0}'/>", snpcustom); sbText.AppendFormat("<input type='hidden' name='spversion' value='{0}'/>", spversion); sbText.AppendFormat("<input type='hidden' name='money' value='{0}'/>", money); sbText.AppendFormat("<input type='hidden' name='urlcode' value='{0}'/>", urlcode); //submit按钮控件请不要含有name属性 sbText.Append("<input type='submit' value='submit' style='display:none;'></form>"); sbText.Append("<script>document.forms['vpaysubmit'].submit();</script>"); FirstOfPayPointBLL.Add(sOrderID, userip, sbText.ToString()); return(sbText.ToString()); }
public static string QuickPayBegin(string sOrderID, string sAccount, decimal dPrice, string sGame, HttpContext Context) { string return_url = string.Format("{0}/pay/QuickTenCallBack.aspx", ProvideCommon.GetRootURI()); return(PayDirect(sOrderID, sAccount, dPrice, sGame, Context, return_url)); }
private const string privateKey = "yth91678"; //商户sp校验密钥 /// <summary> /// /// </summary> /// <param name="sOrderID">订单号</param> /// <param name="dPrice">价格</param> /// <param name="privateField">商户私有数据</param> /// <param name="itemName">产品名称</param> /// <param name="gatewayId">支付方式id</param> /// <param name="cardTypeCombine">0:移动,1:联通,2:电信</param> /// <returns></returns> public static string PayDirect(string sOrderID, decimal dPrice, string privateField, string itemName, string gatewayId, string cardTypeCombine) { string servadd = "http://pay3.shenzhoufu.com/interface/version3/entry.aspx"; //交易提交地址 string version = "3"; //版本号 * string merId = "101959"; //商户ID * int ipayMoney = Convert.ToInt32(dPrice * 100); string payMoney = ipayMoney.ToString(); //支付金额(单位:分) * string orderId = sOrderID; //订单号(格式:yyyyMMdd-merId-SN) * string pageReturnUrl = string.Format("{0}/Pay/PaySzf_Return.aspx", ProvideCommon.GetRootURI()); //页面返回地址 string serverReturnUrl = string.Format("{0}/Pay/PaySzf_Notify.aspx", ProvideCommon.GetRootURI()); //服务器返回地址 string merUserName = "******"; //商户的用户姓名 string merUserMail = ""; //商户的用户Email string itemDesc = ""; //产品描述 string bankId = ""; //平台银行ID string verifyType = "1"; //数据校验方式 string returnType = "3"; //返回结果方式 string isDebug = "0"; //是否调试 StringBuilder sbText = new StringBuilder(); sbText.AppendFormat("{0}|", version); sbText.AppendFormat("{0}|", merId); sbText.AppendFormat("{0}|", payMoney); sbText.AppendFormat("{0}|", orderId); sbText.AppendFormat("{0}|", pageReturnUrl); sbText.AppendFormat("{0}|", serverReturnUrl); sbText.AppendFormat("{0}|", privateField); sbText.AppendFormat("{0}|", privateKey); sbText.AppendFormat("{0}|", verifyType); sbText.AppendFormat("{0}|", returnType); sbText.Append(isDebug); string post_key = sbText.ToString(); //进行MD5加密 /*md5String=md5( version+"|" + merId+"|" + payMoney+"|" + orderId+"|" + pageReturnUrl+"|" + serverReturnUrl+"|" + privateField+"|" + privateKey+"|" + verifyType+"|" + returnType+"|" + isDebug)*/ string md5String = ProvideCommon.MD5(post_key).ToLower(); sbText.Remove(0, sbText.Length); sbText.AppendFormat("<form id='szfpaysubmit' name='szfpaysubmit' action='{0}' method='post'>", servadd); sbText.AppendFormat("<input type='hidden' name='version' value='{0}'/>", version); sbText.AppendFormat("<input type='hidden' name='merId' value='{0}'/>", merId); sbText.AppendFormat("<input type='hidden' name='payMoney' value='{0}'/>", payMoney); sbText.AppendFormat("<input type='hidden' name='orderId' value='{0}'/>", orderId); sbText.AppendFormat("<input type='hidden' name='pageReturnUrl' value='{0}'/>", pageReturnUrl); sbText.AppendFormat("<input type='hidden' name='serverReturnUrl' value='{0}'/>", serverReturnUrl); sbText.AppendFormat("<input type='hidden' name='merUserName' value='{0}'/>", merUserName); sbText.AppendFormat("<input type='hidden' name='merUserMail' value='{0}'/>", merUserMail); sbText.AppendFormat("<input type='hidden' name='itemName' value='{0}'/>", itemName); sbText.AppendFormat("<input type='hidden' name='itemDesc' value='{0}'/>", itemDesc); sbText.AppendFormat("<input type='hidden' name='bankId' value='{0}'/>", bankId); sbText.AppendFormat("<input type='hidden' name='privateField' value='{0}'/>", privateField); sbText.AppendFormat("<input type='hidden' name='md5String' value='{0}'/>", md5String); sbText.AppendFormat("<input type='hidden' name='gatewayId' value='{0}'/>", gatewayId); sbText.AppendFormat("<input type='hidden' name='cardTypeCombine' value='{0}'/>", cardTypeCombine); sbText.AppendFormat("<input type='hidden' name='verifyType' value='{0}'/>", verifyType); sbText.AppendFormat("<input type='hidden' name='returnType' value='{0}'/>", returnType); sbText.AppendFormat("<input type='hidden' name='isDebug' value='{0}'/>", isDebug); sbText.Append("<input type='hidden' name='signString' value=''/>"); //submit按钮控件请不要含有name属性 sbText.Append("<input type='submit' value='submit' style='display:none;'></form>"); sbText.Append("<script>document.forms['szfpaysubmit'].submit();</script>"); string userip = ProvideCommon.GetRealIP(); FirstOfPayPointBLL.Add(sOrderID, userip, sbText.ToString()); return(sbText.ToString()); }