Browse Source

支付宝电脑支付Demo

小柒2012 7 years ago
parent
commit
2826d43a64

+ 6 - 0
pom.xml

@@ -35,6 +35,7 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-thymeleaf</artifactId>
 		</dependency>
+		<!-- 热部署 -->
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>springloaded</artifactId>
@@ -78,6 +79,11 @@
 		    <artifactId>core</artifactId>
 		    <version>3.2.1</version>
 		</dependency>
+		<dependency>
+			<groupId>net.sourceforge.nekohtml</groupId>
+			<artifactId>nekohtml</artifactId>
+			<version>1.9.22</version>
+		</dependency>  
 	</dependencies>
 	<build>
 		<finalName>spring-boot-pay</finalName>

+ 8 - 0
src/main/java/com/itstyle/Application.java

@@ -4,6 +4,8 @@ import org.apache.log4j.Logger;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
 
 import com.alipay.demo.trade.config.Configs;
 /**
@@ -14,9 +16,15 @@ import com.alipay.demo.trade.config.Configs;
  */
 @EnableAutoConfiguration
 @ComponentScan(basePackages={"com.itstyle.modules"})
+@Controller
 public class Application  {
 	private static final Logger logger = Logger.getLogger(Application.class);
 	
+	@RequestMapping("/")
+    public String   greeting() {
+        return "index";
+    }
+	
 	public static void main(String[] args) throws InterruptedException {
 		SpringApplication.run(Application.class, args);
 		//初始化 支付宝参数 涉及机密 此文件不提交 请自行配置加载

+ 9 - 0
src/main/java/com/itstyle/common/model/Product.java

@@ -9,6 +9,7 @@ import java.io.Serializable;
 public class Product implements Serializable {
 	private static final long serialVersionUID = 1L;
 	private String productId;// 商品ID
+	private String subject;//订单名称 
 	private String body;// 商品描述
 	private String totalFee;// 总金额(单位是分)
 	private String outTradeNo;// 订单号(唯一)
@@ -108,4 +109,12 @@ public class Product implements Serializable {
 	public void setFrontUrl(String frontUrl) {
 		this.frontUrl = frontUrl;
 	}
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
 }

+ 19 - 1
src/main/java/com/itstyle/modules/alipay/controller/AliPayController.java

@@ -10,13 +10,17 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
 import com.alipay.api.AlipayApiException;
 import com.alipay.api.internal.util.AlipaySignature;
 import com.alipay.demo.trade.config.Configs;
+import com.itstyle.common.model.Product;
+import com.itstyle.modules.alipay.service.IAliPayService;
 /**
  * 支付宝二维码支付
  * 创建者 科帮网
@@ -26,8 +30,22 @@ import com.alipay.demo.trade.config.Configs;
 @RequestMapping(value = "alipay")
 public class AliPayController {
 	private static final Logger logger = LoggerFactory.getLogger(AliPayController.class);
+	@Autowired
+	private IAliPayService aliPayService;
+
+	@RequestMapping("/index")
+    public String   index() {
+        return "alipay/index";
+    }
+	@RequestMapping("/pcPay")
+    public String  pcPay(Product product,ModelMap map) {
+		logger.info("电脑支付");
+		String form  =  aliPayService.aliPayPc(product);
+		map.addAttribute("form", form);
+		return "alipay/pay";
+    }
     /**
-     * 支付宝支付回调
+     * 支付宝支付回调(二维码、H5、网站)
      * @Author  科帮网
      * @param request
      * @param response

+ 12 - 0
src/main/java/com/itstyle/modules/alipay/service/IAliPayService.java

@@ -55,6 +55,7 @@ public interface IAliPayService {
 	 */
 	String downloadBillUrl(String billDate,String billType);
 	/**
+	 * 手机H5支付、腾讯相关软件下不支持、使用UC等浏览器打开
 	 * 方法一:
 	 * 对于页面跳转类API,SDK不会也无法像系统调用类API一样自动请求支付宝并获得结果,而是在接受request请求对象后,
 	 * 为开发者生成前台页面请求需要的完整form表单的html(包含自动提交脚本),商户直接将这个表单的String输出到http response中即可。
@@ -70,4 +71,15 @@ public interface IAliPayService {
 	 * attach 附件参数 使用json格式传递 用于回调区分
 	 */
 	String aliPayMobile(Product product);
+	/**
+	 * 网站支付
+	 * @Author  科帮网
+	 * @param product
+	 * @return  String
+	 * @Date	2017730
+	 * 更新日志
+	 * 2017730日  科帮网 首次创建
+	 *
+	 */
+	String aliPayPc(Product product);
 }

+ 29 - 4
src/main/java/com/itstyle/modules/alipay/service/impl/AliPayServiceImpl.java

@@ -14,6 +14,7 @@ import com.alipay.api.AlipayClient;
 import com.alipay.api.AlipayResponse;
 import com.alipay.api.request.AlipayDataDataserviceBillDownloadurlQueryRequest;
 import com.alipay.api.request.AlipayTradeCloseRequest;
+import com.alipay.api.request.AlipayTradePagePayRequest;
 import com.alipay.api.request.AlipayTradeWapPayRequest;
 import com.alipay.api.response.AlipayDataDataserviceBillDownloadurlQueryResponse;
 import com.alipay.api.response.AlipayTradeCloseResponse;
@@ -218,17 +219,15 @@ public class AliPayServiceImpl implements IAliPayService {
 	@Override
 	public String aliPayMobile(Product product) {
 		logger.info("支付宝手机支付下单");
-		String  totalFee =  CommonUtil.divide(product.getTotalFee(), "100").toString();
 		AlipayTradeWapPayRequest alipayRequest = new AlipayTradeWapPayRequest();
-		String subject = product.getBody();
 		String returnUrl = "回调地址 http 自定义";
 		alipayRequest.setReturnUrl(returnUrl);//前台通知
 		String notifyUrl  = Constants.PAY_URL.get("alipay_notify_url");
         alipayRequest.setNotifyUrl(notifyUrl);//后台回调
         JSONObject bizContent = new JSONObject();
         bizContent.put("out_trade_no", product.getOutTradeNo());
-        bizContent.put("total_amount", totalFee);//订单金额
-        bizContent.put("subject",subject);//订单标题
+        bizContent.put("total_amount", product.getTotalFee());//订单金额:元
+        bizContent.put("subject",product.getSubject());//订单标题
         bizContent.put("seller_id", Configs.getPid());//实际收款账号,一般填写商户PID即可
         bizContent.put("product_code", "QUICK_WAP_PAY");//手机网页支付
 		bizContent.put("body", "两个苹果五毛钱");
@@ -243,4 +242,30 @@ public class AliPayServiceImpl implements IAliPayService {
         }
         return form;
 	}
+	@Override
+	public String aliPayPc(Product product) {
+		logger.info("支付宝PC支付下单");
+		AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
+		String returnUrl = "前台回调地址 http 自定义";
+		alipayRequest.setReturnUrl(returnUrl);//前台通知
+		String notifyUrl  = "后台回调地址 http 自定义";
+        alipayRequest.setNotifyUrl(notifyUrl);//后台回调
+        JSONObject bizContent = new JSONObject();
+        bizContent.put("out_trade_no", product.getOutTradeNo());
+        bizContent.put("total_amount", product.getTotalFee());//订单金额:元
+        bizContent.put("subject",product.getSubject());//订单标题
+        bizContent.put("seller_id", Configs.getPid());//实际收款账号,一般填写商户PID即可
+        bizContent.put("product_code", "FAST_INSTANT_TRADE_PAY");//电脑网站支付
+		bizContent.put("body", "两个苹果五毛钱");
+		String biz = bizContent.toString().replaceAll("\"", "'");
+        alipayRequest.setBizContent(biz);
+        logger.info("业务参数:"+alipayRequest.getBizContent());
+        String form = Constants.FAIL;
+        try {
+            form = AliPayConfig.getAlipayClient().pageExecute(alipayRequest).getBody();
+        } catch (AlipayApiException e) {
+        	logger.error("支付宝构造表单失败",e);
+        }
+        return form;
+	}
 }

+ 12 - 0
src/main/resources/application-dev.properties

@@ -15,3 +15,15 @@ server.tomcat.uri-encoding=UTF-8
 #spring boot\u4ece\u63a7\u5236\u53f0\u6253\u5370\u51fa\u6765\u7684\u65e5\u5fd7\u7ea7\u522b\u53ea\u6709ERROR, WARN \u8fd8\u6709INFO\uff0c\u5982\u679c\u4f60\u60f3\u8981\u6253\u5370debug\u7ea7\u522b\u7684\u65e5\u5fd7
 #debug=true
 logging.level.root=INFO
+
+spring.thymeleaf.mode=LEGACYHTML5
+
+#dev tools
+spring.devtools.livereload.enabled=true
+spring.thymeleaf.cache=false
+spring.thymeleaf.cache-period=0
+spring.thymeleaf.template.cache=false
+# \u9759\u6001\u6587\u4ef6\u8bf7\u6c42\u5339\u914d\u65b9\u5f0f
+spring.mvc.static-path-pattern=/**
+# \u4fee\u6539\u9ed8\u8ba4\u7684\u9759\u6001\u5bfb\u5740\u8d44\u6e90\u76ee\u5f55
+spring.resources.static-locations = classpath:/templates/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/

+ 183 - 0
src/main/resources/templates/alipay/css/alipay.css

@@ -0,0 +1,183 @@
+* {
+	margin: 0;
+	padding: 0;
+}
+
+ul, ol {
+	list-style: none;
+}
+
+body {
+	font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande",
+		sans-serif;
+}
+
+.tab-head {
+	margin-left: 120px;
+	margin-bottom: 10px;
+}
+
+.tab-content {
+	clear: left;
+	display: none;
+}
+
+h2 {
+	border-bottom: solid #02aaf1 2px;
+	width: 200px;
+	height: 25px;
+	margin: 0;
+	float: left;
+	text-align: center;
+	font-size: 16px;
+}
+
+.selected {
+	color: #FFFFFF;
+	background-color: #02aaf1;
+}
+
+.show {
+	clear: left;
+	display: block;
+}
+
+.hidden {
+	display: none;
+}
+
+.new-btn-login-sp {
+	padding: 1px;
+	display: inline-block;
+	width: 75%;
+}
+
+.new-btn-login {
+	background-color: #02aaf1;
+	color: #FFFFFF;
+	font-weight: bold;
+	border: none;
+	width: 100%;
+	height: 30px;
+	border-radius: 5px;
+	font-size: 16px;
+}
+
+#main {
+	width: 100%;
+	margin: 0 auto;
+	font-size: 14px;
+}
+
+.red-star {
+	color: #f00;
+	width: 10px;
+	display: inline-block;
+}
+
+.null-star {
+	color: #fff;
+}
+
+.content {
+	margin-top: 5px;
+}
+
+.content dt {
+	width: 100px;
+	display: inline-block;
+	float: left;
+	margin-left: 20px;
+	color: #666;
+	font-size: 13px;
+	margin-top: 8px;
+}
+
+.content dd {
+	margin-left: 120px;
+	margin-bottom: 5px;
+}
+
+.content dd input {
+	width: 85%;
+	height: 28px;
+	border: 0;
+	-webkit-border-radius: 0;
+	-webkit-appearance: none;
+}
+
+#foot {
+	margin-top: 10px;
+	position: absolute;
+	bottom: 15px;
+	width: 100%;
+}
+
+.foot-ul {
+	width: 100%;
+}
+
+.foot-ul li {
+	width: 100%;
+	text-align: center;
+	color: #666;
+}
+
+.note-help {
+	color: #999999;
+	font-size: 12px;
+	line-height: 130%;
+	margin-top: 5px;
+	width: 100%;
+	display: block;
+}
+
+#btn-dd {
+	margin: 20px;
+	text-align: center;
+}
+
+.foot-ul {
+	width: 100%;
+}
+
+.one_line {
+	display: block;
+	height: 1px;
+	border: 0;
+	border-top: 1px solid #eeeeee;
+	width: 100%;
+	margin-left: 20px;
+}
+
+.am-header {
+	display: -webkit-box;
+	display: -ms-flexbox;
+	display: box;
+	width: 100%;
+	position: relative;
+	padding: 7px 0;
+	-webkit-box-sizing: border-box;
+	-ms-box-sizing: border-box;
+	box-sizing: border-box;
+	background: #1D222D;
+	height: 50px;
+	text-align: center;
+	-webkit-box-pack: center;
+	-ms-flex-pack: center;
+	box-pack: center;
+	-webkit-box-align: center;
+	-ms-flex-align: center;
+	box-align: center;
+}
+
+.am-header h1 {
+	-webkit-box-flex: 1;
+	-ms-flex: 1;
+	box-flex: 1;
+	line-height: 18px;
+	text-align: center;
+	font-size: 18px;
+	font-weight: 300;
+	color: #fff;
+}

+ 252 - 0
src/main/resources/templates/alipay/index.html

@@ -0,0 +1,252 @@
+<!DOCTYPE html>
+<!-- 哈哈哈 我是个天才 -->
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+<link rel="stylesheet" th:href="@{/alipay/css/alipay.css}" />
+<title>支付宝电脑网站支付</title>
+</head>
+<body text=#000000 bgColor="#ffffff" leftMargin=0 topMargin=5>
+	<header class="am-header">
+	<h1>支付宝电脑网站支付体验入口页</h1>
+	</header>
+	<div id="main">
+		<div id="tabhead" class="tab-head">
+			<h2 id="tab1" class="selected" name="tab">付 款</h2>
+			<h2 id="tab2" name="tab">交 易 查 询</h2>
+			<h2 id="tab3" name="tab">退 款</h2>
+			<h2 id="tab4" name="tab">退 款 查 询</h2>
+			<h2 id="tab5" name="tab">交 易 关 闭</h2>
+			<h2 id="tab6" name="tab">扫码支付</h2>
+		</div>
+		<form name=alipayment action=pcPay method=post
+			target="_blank">
+			<div id="body1" class="show" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDout_trade_no" name="outTradeNo" />
+					</dd>
+					<hr class="one_line">
+					<dt>订单名称 :</dt>
+					<dd>
+						<input id="WIDsubject" name="subject" />
+					</dd>
+					<hr class="one_line">
+					<dt>付款金额 :</dt>
+					<dd>
+						<input id="WIDtotal_amount" name="totalFee" />
+					</dd>
+					<hr class="one_line">
+					<dt>商品描述:</dt>
+					<dd>
+						<input id="WIDbody" name="body" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">付 款</button>
+						</span> <span class="note-help">如果您点击“付款”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<form name=tradequery action=alipay.trade.query.jsp method=post
+			target="_blank">
+			<div id="body2" class="tab-content" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDTQout_trade_no" name="WIDTQout_trade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>支付宝交易号 :</dt>
+					<dd>
+						<input id="WIDTQtrade_no" name="WIDTQtrade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">交 易 查 询</button>
+						</span> <span class="note-help">商户订单号与支付宝交易号二选一,如果您点击“交易查询”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<form name=traderefund action=alipay.trade.refund.jsp method=post
+			target="_blank">
+			<div id="body3" class="tab-content" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDTRout_trade_no" name="WIDTRout_trade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>支付宝交易号 :</dt>
+					<dd>
+						<input id="WIDTRtrade_no" name="WIDTRtrade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>退款金额 :</dt>
+					<dd>
+						<input id="WIDTRrefund_amount" name="WIDTRrefund_amount" />
+					</dd>
+					<hr class="one_line">
+					<dt>退款原因 :</dt>
+					<dd>
+						<input id="WIDTRrefund_reason" name="WIDTRrefund_reason" />
+					</dd>
+					<hr class="one_line">
+					<dt>退款请求号 :</dt>
+					<dd>
+						<input id="WIDTRout_request_no" name="WIDTRout_request_no" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">退 款</button>
+						</span> <span class="note-help">商户订单号与支付宝交易号二选一,如果您点击“退款”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<form name=traderefundquery
+			action=alipay.trade.fastpay.refund.query.jsp method=post
+			target="_blank">
+			<div id="body4" class="tab-content" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDRQout_trade_no" name="WIDRQout_trade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>支付宝交易号 :</dt>
+					<dd>
+						<input id="WIDRQtrade_no" name="WIDRQtrade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>退款请求号 :</dt>
+					<dd>
+						<input id="WIDRQout_request_no" name="WIDRQout_request_no" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">退 款 查 询</button>
+						</span> <span class="note-help">商户订单号与支付宝交易号二选一,如果您点击“退款查询”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<form name=tradeclose action=alipay.trade.close.jsp method=post
+			target="_blank">
+			<div id="body5" class="tab-content" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDTCout_trade_no" name="WIDTCout_trade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt>支付宝交易号 :</dt>
+					<dd>
+						<input id="WIDTCtrade_no" name="WIDTCtrade_no" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">交 易 关 闭</button>
+						</span> <span class="note-help">商户订单号与支付宝交易号二选一,如果您点击“交易关闭”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<form name=alipayqc  method=post
+			target="_blank">
+			<div id="body6"  class="tab-content" name="divcontent">
+				<dl class="content">
+					<dt>商户订单号 :</dt>
+					<dd>
+						<input id="WIDout_trade_no" name="outTradeNo" />
+					</dd>
+					<hr class="one_line">
+					<dt>订单名称 :</dt>
+					<dd>
+						<input id="WIDsubject" name="subject" />
+					</dd>
+					<hr class="one_line">
+					<dt>付款金额 :</dt>
+					<dd>
+						<input id="WIDtotal_amount" name="totalFee" />
+					</dd>
+					<hr class="one_line">
+					<dt>商品描述:</dt>
+					<dd>
+						<input id="WIDbody" name="body" />
+					</dd>
+					<hr class="one_line">
+					<dt></dt>
+					<dd id="btn-dd">
+						<span class="new-btn-login-sp">
+							<button class="new-btn-login" type="submit"
+								style="text-align: center;">付 款</button>
+						</span> <span class="note-help">如果您点击“付款”按钮,即表示您同意该次的执行操作。</span>
+					</dd>
+				</dl>
+			</div>
+		</form>
+		<div id="foot">
+			<ul class="foot-ul">
+				<li>支付宝版权所有 2015-2018 ALIPAY.COM</li>
+			</ul>
+		</div>
+	</div>
+</body>
+<script language="javascript">
+	var tabs = document.getElementsByName('tab');
+	var contents = document.getElementsByName('divcontent');
+	
+	(function changeTab(tab) {
+	    for(var i = 0, len = tabs.length; i < len; i++) {
+	        tabs[i].onmouseover = showTab;
+	    }
+	})();
+	
+	function showTab() {
+	    for(var i = 0, len = tabs.length; i < len; i++) {
+	        if(tabs[i] === this) {
+	            tabs[i].className = 'selected';
+	            contents[i].className = 'show';
+	        } else {
+	            tabs[i].className = '';
+	            contents[i].className = 'tab-content';
+	        }
+	    }
+	}
+	
+	function GetDateNow() {
+		var vNow = new Date();
+		var sNow = "";
+		sNow += String(vNow.getFullYear());
+		sNow += String(vNow.getMonth() + 1);
+		sNow += String(vNow.getDate());
+		sNow += String(vNow.getHours());
+		sNow += String(vNow.getMinutes());
+		sNow += String(vNow.getSeconds());
+		sNow += String(vNow.getMilliseconds());
+		document.getElementById("WIDout_trade_no").value =  sNow;
+		document.getElementById("WIDsubject").value = "科帮网测试支付";
+		document.getElementById("WIDtotal_amount").value = "100";
+	}
+	GetDateNow();
+</script>
+</html>

+ 11 - 0
src/main/resources/templates/alipay/pay.html

@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<!-- 哈哈哈 我是个天才 -->
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+<title>支付宝电脑网站支付</title>
+</head>
+<body th:utext=${form}>
+	电脑支付
+</body>
+</html>

+ 13 - 0
src/main/resources/templates/error/404.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<!-- 哈哈哈 我是个天才 -->
+<html xmlns:th="http://www.thymeleaf.org">
+<head lang="en">
+    <meta charset="UTF-8" />
+    <title></title>
+</head>
+<body>
+<div style="text-align:center">
+	页面不见了
+</div>
+</body>
+</html>

+ 13 - 0
src/main/resources/templates/error/500.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<!-- 哈哈哈 我是个天才 -->
+<html xmlns:th="http://www.thymeleaf.org">
+<head lang="en">
+    <meta charset="UTF-8" />
+    <title></title>
+</head>
+<body>
+<div style="text-align:center">
+	系统异常
+</div>
+</body>
+</html>

+ 15 - 0
src/main/resources/templates/index.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<!-- 哈哈哈 我是个天才 -->
+<html xmlns:th="http://www.thymeleaf.org">
+<head lang="en">
+    <meta charset="UTF-8" />
+    <title></title>
+</head>
+<body>
+<div style="text-align:center">
+    <a th:href="@{/alipay/index}" >阿里支付</a>
+    <a th:href="@{/weixin/index}" >微信支付</a>
+    <a th:href="@{/alipay/index}" >银联支付</a>
+</div>
+</body>
+</html>