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
45a278c5
Commit
45a278c5
authored
Sep 29, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建项目
parent
c3007940
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
PayTestController.java
...rc/main/java/cn/quant/baa/pay/rest/PayTestController.java
+5
-2
h5.html
baa-pay-server/src/main/resources/templates/pay/h5.html
+7
-10
No files found.
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/PayTestController.java
View file @
45a278c5
...
@@ -10,7 +10,9 @@ import cn.quant.baa.pay.model.web.CheckRefundRequestData;
...
@@ -10,7 +10,9 @@ import cn.quant.baa.pay.model.web.CheckRefundRequestData;
import
cn.quant.baa.pay.model.web.PayRequestData
;
import
cn.quant.baa.pay.model.web.PayRequestData
;
import
cn.quant.baa.pay.service.TransactionService
;
import
cn.quant.baa.pay.service.TransactionService
;
import
cn.quant.spring.context.ServerApplicationContext
;
import
cn.quant.spring.context.ServerApplicationContext
;
import
cn.quant.spring.http.HttpResponseData
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -73,7 +75,7 @@ public class PayTestController extends BusinessController {
...
@@ -73,7 +75,7 @@ public class PayTestController extends BusinessController {
@PostMapping
(
"goPay"
)
@PostMapping
(
"goPay"
)
@BusinessMapping
(
session
=
1
)
@BusinessMapping
(
session
=
1
)
@ResponseBody
@ResponseBody
public
ChannelResponse
goPay
(
@RequestBody
(
required
=
false
)
BusinessRequest
<
PayRequestData
>
requestData
)
throws
Exception
{
public
ResponseEntity
goPay
(
@RequestBody
(
required
=
false
)
BusinessRequest
<
PayRequestData
>
requestData
)
throws
Exception
{
PayRequestData
data
=
requestData
.
getData
();
PayRequestData
data
=
requestData
.
getData
();
String
str
=
"{\"subject\":\"测试订单1\",\"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}]}"
;
String
str
=
"{\"subject\":\"测试订单1\",\"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}]}"
;
PayRequestData
payRequestData
=
objectMapper
.
readValue
(
str
,
PayRequestData
.
class
);
PayRequestData
payRequestData
=
objectMapper
.
readValue
(
str
,
PayRequestData
.
class
);
...
@@ -87,7 +89,8 @@ public class PayTestController extends BusinessController {
...
@@ -87,7 +89,8 @@ public class PayTestController extends BusinessController {
payRequestData
.
setRequestIp
(
"127.0.0.1"
);
payRequestData
.
setRequestIp
(
"127.0.0.1"
);
AcquirerProperties
properties
=
check
(
payRequestData
);
AcquirerProperties
properties
=
check
(
payRequestData
);
ChannelResponse
response
=
transactionService
.
pay
(
properties
,
payRequestData
);
ChannelResponse
response
=
transactionService
.
pay
(
properties
,
payRequestData
);
return
response
;
HttpResponseData
responseData
=
response
(
response
);
return
ResponseEntity
.
ok
(
responseData
);
}
}
...
...
baa-pay-server/src/main/resources/templates/pay/h5.html
View file @
45a278c5
...
@@ -166,7 +166,8 @@
...
@@ -166,7 +166,8 @@
<h1>
手机网站支付接口
</h1>
<h1>
手机网站支付接口
</h1>
</header>
</header>
<div
id=
"main"
>
<div
id=
"main"
>
<form
name=
payment
action=
''
method=
post
target=
"_blank"
enctype=
"application/x-www-form-urlencoded"
th:object=
"${requestData}"
>
<form
name=
payment
action=
''
method=
post
target=
"_blank"
enctype=
"application/x-www-form-urlencoded"
th:object=
"${requestData}"
>
<div
id=
"body"
style=
"clear:left"
>
<div
id=
"body"
style=
"clear:left"
>
<dl
class=
"content"
>
<dl
class=
"content"
>
<dt>
支付方式
<dt>
支付方式
...
@@ -213,7 +214,8 @@
...
@@ -213,7 +214,8 @@
<hr
class=
"one_line"
>
<hr
class=
"one_line"
>
<dt>
通知地址:
</dt>
<dt>
通知地址:
</dt>
<dd>
<dd>
<input
id=
"notifyUrl"
name=
"data[notify_url]"
value=
"https://baa-pay-server-pay.liangkebang.net/debug/merchant/pay"
/>
<input
id=
"notifyUrl"
name=
"data[notify_url]"
value=
"https://baa-pay-server-pay.liangkebang.net/debug/merchant/pay"
/>
</dd>
</dd>
<hr
class=
"one_line"
>
<hr
class=
"one_line"
>
<dt></dt>
<dt></dt>
...
@@ -236,7 +238,7 @@
...
@@ -236,7 +238,7 @@
</div>
</div>
</body>
</body>
<script
language=
"javascript"
>
<script
language=
"javascript"
>
$
(
"
.new-btn-login
"
).
click
(
function
()
{
$
(
"
.new-btn-login
"
).
click
(
function
()
{
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
url
:
'
/pay/goPay
'
,
url
:
'
/pay/goPay
'
,
...
@@ -246,13 +248,8 @@
...
@@ -246,13 +248,8 @@
data
:
JSON
.
stringify
(
$
(
'
form
'
).
serializeJSON
()),
data
:
JSON
.
stringify
(
$
(
'
form
'
).
serializeJSON
()),
contentType
:
"
application/json; charset=utf-8
"
,
contentType
:
"
application/json; charset=utf-8
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
hasOwnProperty
(
"
h5_url
"
))
{
window
.
location
.
href
=
data
.
result
.
prepay
;
window
.
location
.
href
=
data
.
h5_url
;
}
if
(
data
.
hasOwnProperty
(
"
data
"
))
{
window
.
location
.
href
=
data
.
data
;
}
}
// 注意不要在此行增加逗号
}
// 注意不要在此行增加逗号
});
});
});
});
...
...
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