81,092
社区成员
发帖
与我相关
我的任务
分享
<form id="deposit" action="${ctx}/fund/alipay" method="post" target="_blank">
<table cellpadding="10">
<tr>
<td>账户余额</td>
<td class="balance" id="userBalance"></td>
</tr>
<tr>
<td><i class="zfb"></i></td>
<td style="padding-bottom: 0px;">
亲爱的<span class="suppliment_user" id="suppliment_user"></span>,您可以使用支付宝充值积善分,请填写以下信息
</td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios1" value="5" checked> 5元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios2" value="20"> 20元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios3" value="50"> 50元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios4" value="100"> 100元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios5" value="1000"> 1000元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="WIDtotal_fee" id="optionsRadios6" value="5000"> 5000元
</label></td>
</tr>
<tr>
<td></td>
<td><label class="radio inline"> <input type="radio"
name="amount" id="optionsRadios7" value="option7">自定义<input
class="compliment_count" name="WIDtotal_fee" placeholder="充值金额">元
</label></td>
</tr>
<tr>
<td></td>
<td class="warm_prompt">温馨提示:<br />1.采用支付宝充值,1元可以充值1积善值。<br />2.若出现已充值成功的提示,但积善值未到账,可能是网络或者系统繁忙导致,我们会在2个工作日内核对后为您充值<br />3在充值过程中如出现网页错误或打开缓慢时,请先查询支付宝的交易记录,检查扣款是否成功;然后查看积善之家账户是否成功充值。若没有确认,请不要反复刷新页面,以防止重复购买。
</td>
</tr>
<tr>
<td></td>
<td><button class="affirm-donate">立即充值</button></td>
</tr>
</table>
</form>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.alipay.config.*"%>
<%@ page import="com.alipay.util.*"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Map"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>支付宝即时到账交易接口</title>
</head>
<%
////////////////////////////////////请求参数//////////////////////////////////////
//支付类型
String payment_type = "1";
//必填,不能修改
//服务器异步通知页面路径
String notify_url = "http://www.xxx.com/create_direct_pay_by_user-JAVA-UTF-8/notify_url.jsp";
//需http://格式的完整路径,不能加?id=123这类自定义参数
//页面跳转同步通知页面路径
String return_url = "http://www.xxx.com/create_direct_pay_by_user-JAVA-UTF-8/return_url.jsp";
//需http://格式的完整路径,不能加?id=123这类自定义参数,不能写成http://localhost/
//卖家支付宝帐户
String seller_email = new String(request.getParameter("WIDseller_email").getBytes("ISO-8859-1"),"UTF-8");
//必填
//商户订单号
String out_trade_no = new String(request.getParameter("WIDout_trade_no").getBytes("ISO-8859-1"),"UTF-8");
//商户网站订单系统中唯一订单号,必填
//订单名称
String subject = new String(request.getParameter("WIDsubject").getBytes("ISO-8859-1"),"UTF-8");
//必填
//付款金额
String total_fee = new String(request.getParameter("WIDtotal_fee").getBytes("ISO-8859-1"),"UTF-8");
//必填
//订单描述
String body = new String(request.getParameter("WIDbody").getBytes("ISO-8859-1"),"UTF-8");
//商品展示地址
String show_url = new String(request.getParameter("WIDshow_url").getBytes("ISO-8859-1"),"UTF-8");
//需以http://开头的完整路径,例如:http://www.xxx.com/myorder.html
//防钓鱼时间戳
String anti_phishing_key = "";
//若要使用请调用类文件submit中的query_timestamp函数
//客户端的IP地址
String exter_invoke_ip = "";
//非局域网的外网IP地址,如:221.0.0.1
//////////////////////////////////////////////////////////////////////////////////
//把请求参数打包成数组
Map<String, String> sParaTemp = new HashMap<String, String>();
sParaTemp.put("service", "create_direct_pay_by_user");
sParaTemp.put("partner", AlipayConfig.partner);
sParaTemp.put("_input_charset", AlipayConfig.input_charset);
sParaTemp.put("payment_type", payment_type);
sParaTemp.put("notify_url", notify_url);
sParaTemp.put("return_url", return_url);
sParaTemp.put("seller_email", seller_email);
sParaTemp.put("out_trade_no", out_trade_no);
sParaTemp.put("subject", subject);
sParaTemp.put("total_fee", total_fee);
sParaTemp.put("body", body);
sParaTemp.put("show_url", show_url);
sParaTemp.put("anti_phishing_key", anti_phishing_key);
sParaTemp.put("exter_invoke_ip", exter_invoke_ip);
//建立请求
String sHtmlText = AlipaySubmit.buildRequest(sParaTemp,"get","确认");
out.println(sHtmlText);
%>
我的页面填这些必要数据传到这个页面里。。。