问题描述
usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingGateway;publicpartialclass_Default:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){}protectedvoidButton1_Click(objectsender,EventArgse){//按时构造订单号;System.DateTimecurrentTime=newSystem.DateTime();currentTime=System.DateTime.Now;stringout_trade_no=currentTime.ToString("g");out_trade_no=out_trade_no.Replace("-","");out_trade_no=out_trade_no.Replace(":","");out_trade_no=out_trade_no.Replace("","");//业务参数赋值;stringgateway=T_gateway.Text;//'支付接口stringservice=T_service.Text;stringpartner=T_partner.Text;//partner合作伙伴ID保留字段stringsign_type=T_sign_type.Text;stringsubject=T_subject.Text;//subject商品名称stringbody=T_body.Text;//body商品描述stringpayment_type=T_payment_type.Text;//支付类型stringprice=T_total_fee.Text;stringquantity=TextBox1.Text;stringshow_url=T_show_url.Text;stringseller_email=T_seller_email.Text;//卖家账号stringkey=T_key.Text;//partner账户的支付宝安全校验码stringreturn_url=T_return_url.Text;//服务器通知返回接口stringnotify_url=T_notify_url.Text;//服务器通知返回接口string_input_charset=T_inputchatset.Text;stringlogistics_type="POST";stringlogistics_fee=TextBox2.Text;stringlogistics_payment="BUYER_PAY";stringlogistics_type_1="EXPRESS";stringlogistics_fee_1=TextBox3.Text;stringlogistics_payment_1="BUYER_PAY";AliPayap=newAliPay();stringaliay_url=ap.CreatUrl(gateway,service,partner,sign_type,out_trade_no,subject,body,payment_type,price,show_url,seller_email,key,return_url,_input_charset,notify_url,logistics_type,logistics_fee,logistics_payment,logistics_type_1,logistics_fee_1,logistics_payment_1,quantity);Response.Redirect(aliay_url);}}
解决方案
解决方案二:
呵呵,今天我也刚做了个支付宝的接口,把这个方法放到你要支付的页面去调用就行了
解决方案三:
Response.Redirect(aliay_url);这样不行吧,aliay_url应该是个加密串,转向不了吧,应该还有段response.writeform提交的串吧