日期:2014-05-18  浏览次数:20426 次

请教关于支付宝API的问题。。。。。。。。
C# code

 /// <summary>
        /// 构造提交表单HTML数据
        /// </summary>
        /// <param name="sParaTemp">请求参数数组</param>
        /// <param name="gateway">网关地址</param>
        /// <param name="strMethod">提交方式。两个值可选:post、get</param>
        /// <param name="strButtonValue">确认按钮显示文字</param>
        /// <returns>提交表单HTML文本</returns>
        public static string BuildFormHtml(SortedDictionary<string, string> sParaTemp, string gateway, string strMethod, string strButtonValue)
        {
            //待请求参数数组
            Dictionary<string, string> dicPara = new Dictionary<string, string>();
            dicPara = BuildRequestPara(sParaTemp);

            StringBuilder sbHtml = new StringBuilder();

            sbHtml.Append("<form id='alipaysubmit' name='alipaysubmit' action='" + gateway + "_input_charset=" + _input_charset + "' method='" + strMethod.ToLower().Trim() + "'>");

            foreach (KeyValuePair<string, string> temp in dicPara)
            {
                sbHtml.Append("<input type='hidden' name='" + temp.Key + "' value='" + temp.Value + "'/>");
            }

            //submit按钮控件请不要含有name属性
            sbHtml.Append("<input type='submit' value='" + strButtonValue + "' style='display:none;'></form>");

            sbHtml.Append("<script>document.forms['alipaysubmit'].submit();</script>");

            return sbHtml.ToString();
        }



官方给的DEMO。。
想知道为什么要拼一个表单出来...

------解决方案--------------------
探讨

。。发现个严重的问题,我要怎么获取买家的支付宝账号引用:

引用:
买家和卖家的支付宝账号 得事先填好??

还有 有个参数是商品展示地址。。这个参数可有可无的把??

商户号肯定要事先填好的,商品展示地址你就填你那个商品的地址吧

------解决方案--------------------
探讨
引用:
买家的支付宝账号不需要获取,买家自己去支付宝上面填就是了