Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baa-pay-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
贺超
baa-pay-server
Commits
0bb1f12d
Commit
0bb1f12d
authored
Sep 09, 2021
by
刘李鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alipay移动文件路径,完成支付demo
parent
e6978bd5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
938 additions
and
22 deletions
+938
-22
AlipayMerchantAcquirer.java
...quant/baa/pay/acquirer/alipay/AlipayMerchantAcquirer.java
+1
-1
ServerConfiguration.java
...ain/java/cn/quant/baa/pay/config/ServerConfiguration.java
+1
-5
pom.xml
baa-pay-server/pom.xml
+21
-16
PayTestController.java
...rc/main/java/cn/quant/baa/pay/rest/PayTestController.java
+99
-0
checkPay.html
...pay-server/src/main/resources/templates/pay/checkPay.html
+185
-0
checkRefund.html
...-server/src/main/resources/templates/pay/checkRefund.html
+188
-0
h5.html
baa-pay-server/src/main/resources/templates/pay/h5.html
+267
-0
index.html
baa-pay-server/src/main/resources/templates/pay/index.html
+176
-0
No files found.
baa-pay-core/src/main/java/cn/quant/baa/pay/acquirer/
weixin
/AlipayMerchantAcquirer.java
→
baa-pay-core/src/main/java/cn/quant/baa/pay/acquirer/
alipay
/AlipayMerchantAcquirer.java
View file @
0bb1f12d
package
cn
.
quant
.
baa
.
pay
.
acquirer
.
weixin
;
package
cn
.
quant
.
baa
.
pay
.
acquirer
.
alipay
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
...
...
baa-pay-core/src/main/java/cn/quant/baa/pay/config/ServerConfiguration.java
View file @
0bb1f12d
...
@@ -4,7 +4,7 @@ import cn.quant.baa.pay.acquirer.AcquirerConfiguration;
...
@@ -4,7 +4,7 @@ import cn.quant.baa.pay.acquirer.AcquirerConfiguration;
import
cn.quant.baa.pay.acquirer.AcquirerConfigurer
;
import
cn.quant.baa.pay.acquirer.AcquirerConfigurer
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.acquirer.AcquirerProperties
;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.MerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.
weixin
.AlipayMerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.
alipay
.AlipayMerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.weixin.WeiXinMerchantAcquirer
;
import
cn.quant.baa.pay.acquirer.weixin.WeiXinMerchantAcquirer
;
import
cn.quant.baa.pay.jpa.entity.*
;
import
cn.quant.baa.pay.jpa.entity.*
;
import
cn.quant.baa.pay.jpa.repository.*
;
import
cn.quant.baa.pay.jpa.repository.*
;
...
@@ -13,10 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -13,10 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
javax.crypto.NoSuchPaddingException
;
import
java.security.InvalidAlgorithmParameterException
;
import
java.security.InvalidKeyException
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
...
...
baa-pay-server/pom.xml
View file @
0bb1f12d
...
@@ -67,6 +67,10 @@
...
@@ -67,6 +67,10 @@
<artifactId>
junit
</artifactId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
@@ -81,6 +85,7 @@
...
@@ -81,6 +85,7 @@
<include>
**/*.xml
</include>
<include>
**/*.xml
</include>
<include>
**/*.properties
</include>
<include>
**/*.properties
</include>
<include>
**/*.txt
</include>
<include>
**/*.txt
</include>
<include>
**/*.html
</include>
</includes>
</includes>
</resource>
</resource>
<resource>
<resource>
...
@@ -125,22 +130,22 @@
...
@@ -125,22 +130,22 @@
</configuration>
</configuration>
</plugin>
</plugin>
<!--<plugin>-->
<!--<plugin>-->
<!--<artifactId>maven-assembly-plugin</artifactId>-->
<!--<artifactId>maven-assembly-plugin</artifactId>-->
<!--<configuration>-->
<!--<configuration>-->
<!--<appendAssemblyId>false</appendAssemblyId>-->
<!--<appendAssemblyId>false</appendAssemblyId>-->
<!--<descriptors>-->
<!--<descriptors>-->
<!--<descriptor>src/assembly/assembly.xml</descriptor>-->
<!--<descriptor>src/assembly/assembly.xml</descriptor>-->
<!--</descriptors>-->
<!--</descriptors>-->
<!--</configuration>-->
<!--</configuration>-->
<!--<executions>-->
<!--<executions>-->
<!--<execution>-->
<!--<execution>-->
<!--<id>make-assembly</id>-->
<!--<id>make-assembly</id>-->
<!--<phase>package</phase>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goals>-->
<!--<goal>single</goal>-->
<!--<goal>single</goal>-->
<!--</goals>-->
<!--</goals>-->
<!--</execution>-->
<!--</execution>-->
<!--</executions>-->
<!--</executions>-->
<!--</plugin>-->
<!--</plugin>-->
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/PayTestController.java
0 → 100644
View file @
0bb1f12d
package
cn
.
quant
.
baa
.
pay
.
rest
;
import
cn.quant.baa.pay.annotation.BusinessMapping
;
import
cn.quant.baa.pay.context.TransactionSession
;
import
cn.quant.baa.pay.model.BusinessRequest
;
import
cn.quant.baa.pay.model.web.CheckPayRequestData
;
import
cn.quant.baa.pay.model.web.CheckRefundRequestData
;
import
cn.quant.baa.pay.model.web.PayRequestData
;
import
cn.quant.baa.pay.service.TransactionService
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.PropertyNamingStrategy
;
import
com.fasterxml.jackson.databind.json.JsonMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
org.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Created with IntelliJ IDEA.
* Author: Lipeng Liu
* Date: 2021/9/9
* Time: 上午9:51
* Description: No Description
*/
@Controller
//@RestController
@RequestMapping
(
"pay"
)
public
class
PayTestController
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
@Autowired
private
TransactionService
transactionService
;
@GetMapping
(
""
)
public
String
getPay
(
Model
model
)
{
return
"pay/index"
;
}
@RequestMapping
(
"h5"
)
public
String
getH5
(
Model
model
)
{
return
"pay/h5"
;
}
@RequestMapping
(
"checkPay"
)
public
String
check
(
CheckPayRequestData
data
,
Model
model
,
HttpServletRequest
servletRequest
)
{
String
res
=
""
;
if
(
servletRequest
.
getMethod
().
equals
(
"POST"
))
{
res
=
transactionService
.
checkPay
(
data
).
toString
();
}
model
.
addAttribute
(
"res"
,
res
);
return
"pay/checkPay"
;
}
@RequestMapping
(
"checkRefund"
)
public
String
check
(
CheckRefundRequestData
data
,
Model
model
,
HttpServletRequest
servletRequest
)
{
String
res
=
""
;
if
(
servletRequest
.
getMethod
().
equals
(
"POST"
))
{
res
=
transactionService
.
checkRefund
(
data
).
toString
();
}
model
.
addAttribute
(
"res"
,
res
);
return
"pay/checkRefund"
;
}
@PostMapping
(
"goPay"
)
@BusinessMapping
(
session
=
1
)
@ResponseBody
public
JsonNode
goPay
(
@RequestBody
(
required
=
false
)
BusinessRequest
<
PayRequestData
>
requestData
)
{
PayRequestData
data
=
requestData
.
getData
();
String
str
=
"{\"subject\":\"测试订单1\",\"mchId\":\"wx2f44c7fe7b08458d\",\"chanId\":\"75772285618946307\",\"outTradeNo\":\"11111111223\",\"originalAmount\":\"110.00\",\"amount\":0.01,\"discounts\":\"10.00\",\"notifyUrl\":\"http://127.0.0.1:8080/notifyUrl\",\"buyerId\":\"777777\",\"attach\":\"AAAA-BBBB-1111-2222\",\"creditAmount\":\"10.00\",\"cashAmount\":\"10\",\"goodsDetail\":[{\"goodsNo\":\"123123\",\"goodsId\":\"11111\",\"goodsName\":\"商品1\",\"quantity\":2,\"price\":\"10.00\",\"discounts\":\"2.5\",\"amount\":\"17.5\",\"attach\":\"---\",\"creditAmount\":123,\"cashAmount\":123}]}"
;
try
{
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
PayRequestData
payRequestData
=
objectMapper
.
readValue
(
str
,
PayRequestData
.
class
);
String
[]
temp
=
data
.
getChanId
().
split
(
"_"
);
payRequestData
.
setChanId
(
temp
[
0
]);
payRequestData
.
setMchId
(
temp
[
1
]);
payRequestData
.
setOutTradeNo
(
data
.
getOutTradeNo
());
payRequestData
.
setSubject
(
data
.
getSubject
());
payRequestData
.
setAmount
(
data
.
getAmount
());
payRequestData
.
setNotifyUrl
(
"http://127.0.0.1:8080/notifyUrl"
);
JsonNode
res
=
transactionService
.
pay
(
payRequestData
);
return
res
;
}
catch
(
JsonProcessingException
e
)
{
e
.
printStackTrace
();
}
return
objectMapper
.
createObjectNode
();
}
}
\ No newline at end of file
baa-pay-server/src/main/resources/templates/pay/checkPay.html
0 → 100644
View file @
0bb1f12d
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
lang=
"CN"
>
<head>
<title>
交易查询
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<style>
*
{
margin
:
0
;
padding
:
0
;
}
ul
,
ol
{
list-style
:
none
;
}
body
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
"Lucida Grande"
,
sans-serif
;
}
.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
,
select
{
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
;
}
</style>
</head>
<body
text=
#000000
bgColor=
"#ffffff"
leftMargin=
0
topMargin=
4
>
<header
class=
"am-header"
>
<h1>
交易查询
</h1>
</header>
<div
id=
"main"
>
<form
name=
alipayment
action=
''
method=
post
>
<div
id=
"body"
style=
"clear:left"
>
<dl
class=
"content"
>
<dt>
支付方式
:
</dt>
<dd>
<select
name=
"chanId"
>
<option
value=
"75772285618946310"
>
微信
</option>
<option
value=
"75772285618946309"
>
支付宝
</option>
</select>
</dd>
<hr
class=
"one_line"
>
<dt>
商户订单号
:
</dt>
<dd>
<input
id=
"WIDout_trade_no"
name=
"outTradeNo"
value=
"11111111218"
/>
</dd>
<hr
class=
"one_line"
>
<dt></dt>
<dd>
<span
style=
"line-height: 28px; color:red;"
>
[[${res}]]
</span>
</dd>
<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>
QUANTGROUP.CN
</li>
</ul>
</div>
</div>
</body>
\ No newline at end of file
baa-pay-server/src/main/resources/templates/pay/checkRefund.html
0 → 100644
View file @
0bb1f12d
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
退款查询
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<style>
*
{
margin
:
0
;
padding
:
0
;
}
ul
,
ol
{
list-style
:
none
;
}
body
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
"Lucida Grande"
,
sans-serif
;
}
.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
,
select
{
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
;
}
</style>
</head>
<body
text=
#000000
bgColor=
"#ffffff"
leftMargin=
0
topMargin=
4
>
<header
class=
"am-header"
>
<h1>
易退款查询
</h1>
</header>
<div
id=
"main"
>
<form
name=
alipayment
action=
''
method=
post
>
<div
id=
"body"
style=
"clear:left"
>
<dl
class=
"content"
>
<dt>
支付方式
:
</dt>
<dd>
<select
name=
"chanId"
>
<option
value=
"75772285618946311"
>
支付宝
</option>
<option
value=
"75772285618946312"
>
微信
</option>
</select>
</dd>
<hr
class=
"one_line"
>
<dt>
退款请求号:
</dt>
<dd>
<input
id=
"WIDout_request_no"
name=
"outRefundNo"
value=
"11111111218"
/>
</dd>
<dt>
商户订单号:
</dt>
<dd>
<input
id=
"WIDout_trade_no"
name=
"outTradeNo"
value=
"11111111218"
/>
</dd>
<hr
class=
"one_line"
>
<dt></dt>
<dd>
<span
style=
"line-height: 28px; color:red;"
>
[[${res}]]
</span>
</dd>
<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>
QUANTGROUP.CN
</li>
</ul>
</div>
</div>
</body>
\ No newline at end of file
baa-pay-server/src/main/resources/templates/pay/h5.html
0 → 100644
View file @
0bb1f12d
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
lang=
"CN"
>
<head>
<title>
手机网站支付接口
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"
></script>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/jquery.serializeJSON/3.2.1/jquery.serializejson.min.js"
></script>
<!-- <meta http-equiv="refresh" content="url=[[${payUrl}]]">-->
<style>
*
{
margin
:
0
;
padding
:
0
;
}
ul
,
ol
{
list-style
:
none
;
}
body
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
"Lucida Grande"
,
sans-serif
;
}
.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
,
.content
dd
select
{
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
;
}
</style>
</head>
<body
text=
#000000
bgColor=
"#ffffff"
leftMargin=
0
topMargin=
4
>
<header
class=
"am-header"
>
<h1>
手机网站支付接口
</h1>
</header>
<div
id=
"main"
>
<form
name=
payment
action=
''
method=
post
target=
"_blank"
enctype=
"application/x-www-form-urlencoded"
th:object=
"${requestData}"
>
<div
id=
"body"
style=
"clear:left"
>
<dl
class=
"content"
>
<dt>
支付方式
:
</dt>
<dd>
<select
name=
"data[chan_id]"
>
<option
value=
"75772285618946307_wx2f44c7fe7b08458d"
>
微信
</option>
<option
value=
"75772285618946317_wxd678efh567hg6787"
>
支付宝
</option>
</select>
</dd>
<hr
class=
"one_line"
>
<dt>
商户订单号
:
</dt>
<dd>
<input
id=
"outTradeNo"
name=
"data[out_trade_no]"
/>
</dd>
<hr
class=
"one_line"
>
<dt>
订单名称
:
</dt>
<dd>
<input
id=
"subject"
name=
"data[subject]"
/>
</dd>
<hr
class=
"one_line"
>
<dt>
付款金额
:
</dt>
<dd>
<input
id=
"amount"
name=
"data[amount]"
/>
</dd>
<hr
class=
"one_line"
>
<dt>
商品描述:
</dt>
<dd>
<input
id=
"body"
name=
"data[body]"
/>
</dd>
<hr
class=
"one_line"
>
<dt></dt>
<dd
id=
"btn-dd"
>
<span
class=
"new-btn-login-sp"
>
<button
class=
"new-btn-login"
type=
"button"
style=
"text-align:center;"
>
确 认
</button>
</span>
<span
class=
"note-help"
>
如果您点击“确认”按钮,即表示您同意该次的执行操作。
</span>
</dd>
</dl>
</div>
</form>
<div
id=
"foot"
>
<ul
class=
"foot-ul"
>
<li>
QUANTGROUP.CN
</li>
</ul>
</div>
</div>
</body>
<script
language=
"javascript"
>
$
(
"
.new-btn-login
"
).
click
(
function
()
{
$
.
ajax
({
type
:
"
post
"
,
url
:
'
/pay/goPay
'
,
async
:
false
,
// 使用同步方式
// 1 需要使用JSON.stringify 否则格式为 a=2&b=3&now=14...
// 2 需要强制类型转换,否则格式为 {"a":"2","b":"3"}
data
:
JSON
.
stringify
(
$
(
'
form
'
).
serializeJSON
()),
contentType
:
"
application/json; charset=utf-8
"
,
dataType
:
"
json
"
,
success
:
function
(
data
)
{
if
(
data
.
hasOwnProperty
(
"
h5_url
"
))
{
window
.
location
.
href
=
data
.
h5_url
;
}
if
(
data
.
hasOwnProperty
(
"
data
"
))
{
window
.
location
.
href
=
data
.
data
;
}
}
// 注意不要在此行增加逗号
});
});
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
(
"
outTradeNo
"
).
value
=
sNow
;
document
.
getElementById
(
"
subject
"
).
value
=
"
测试
"
;
document
.
getElementById
(
"
amount
"
).
value
=
"
0.01
"
;
document
.
getElementById
(
"
body
"
).
value
=
"
购买测试商品0.01元
"
;
}
GetDateNow
();
</script>
</html>
\ No newline at end of file
baa-pay-server/src/main/resources/templates/pay/index.html
0 → 100644
View file @
0bb1f12d
<!DOCTYPE html>
<html
xmlns:th=
"http://www.thymeleaf.org"
lang=
"CN"
>
<head>
<title>
支付中心API
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<style>
*
{
margin
:
0
;
padding
:
0
;
}
ul
,
ol
{
list-style
:
none
;
}
body
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Arial
,
"Lucida Grande"
,
sans-serif
;
}
.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
;
}
</style>
</head>
<body
text=
#000000
bgColor=
"#ffffff"
leftMargin=
0
topMargin=
4
>
<header
class=
"am-header"
>
<h1>
支付中心接口
</h1>
</header>
<div
id=
"main"
>
<div
id=
"body"
style=
"clear:left"
>
<dl
class=
"content"
>
<dt></dt>
<dd
class=
"btn-dd"
>
<span
class=
"new-btn-login-sp"
>
<button
class=
"new-btn-login"
style=
"text-align:center;"
onclick=
"window.open('/pay/h5')"
>
手机网站支付
</button>
</span>
</dd>
<dt></dt>
<dd
class=
"btn-dd"
>
<span
class=
"new-btn-login-sp"
>
<button
class=
"new-btn-login"
style=
"text-align:center;"
onclick=
"window.open('/pay/checkPay')"
>
订单查询
</button>
</span>
</dd>
<dt></dt>
<dd
class=
"btn-dd"
>
<span
class=
"new-btn-login-sp"
>
<button
class=
"new-btn-login"
style=
"text-align:center;"
onclick=
"window.open('/pay/checkRefund')"
>
退款查询
</button>
</span>
</dd>
</dl>
</div>
<div
id=
"foot"
>
<ul
class=
"foot-ul"
>
<li>
QUANTGROUP.CN
</li>
</ul>
</div>
</div>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment