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
c8953b4c
Commit
c8953b4c
authored
Sep 29, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建项目
parent
c03f74ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
CallbackController.java
...c/main/java/cn/quant/baa/pay/rest/CallbackController.java
+8
-1
PayTestController.java
...rc/main/java/cn/quant/baa/pay/rest/PayTestController.java
+5
-5
h5.html
baa-pay-server/src/main/resources/templates/pay/h5.html
+11
-1
No files found.
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/CallbackController.java
View file @
c8953b4c
...
...
@@ -39,6 +39,13 @@ public class CallbackController extends BusinessController {
@Autowired
private
CallbackService
callbackService
;
@ResponseBody
@BusinessMapping
@PostMapping
(
"/debug/merchant/pay"
)
public
ResponseEntity
pay
(
@RequestParam
(
"order_no"
)
String
orderNo
,
@RequestParam
(
"status"
)
String
status
)
throws
Exception
{
logger
.
info
(
"Merchant pay callback : {}, {}"
,
orderNo
,
status
);
return
ResponseEntity
.
ok
(
"ok"
);
}
@ResponseBody
@BusinessMapping
...
...
@@ -47,7 +54,7 @@ public class CallbackController extends BusinessController {
,
@PathVariable
(
"orderNo"
)
String
orderNo
,
@RequestBody
Map
request
)
throws
Exception
{
logger
.
info
(
request
.
toString
());
logger
.
info
(
"Weixin pay callback : {}, {}, {}, {}"
,
chanId
,
acctId
,
orderNo
,
request
.
toString
());
Long
channelId
=
Long
.
parseLong
(
chanId
,
16
);
Long
accountId
=
Long
.
parseLong
(
acctId
,
16
);
...
...
baa-pay-server/src/main/java/cn/quant/baa/pay/rest/PayTestController.java
View file @
c8953b4c
...
...
@@ -75,15 +75,15 @@ public class PayTestController extends BusinessController {
@ResponseBody
public
ChannelResponse
goPay
(
@RequestBody
(
required
=
false
)
BusinessRequest
<
PayRequestData
>
requestData
)
throws
Exception
{
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}]}"
;
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
);
String
[]
temp
=
data
.
getChanId
().
split
(
"_"
);
payRequestData
.
setChanId
(
temp
[
0
]);
// payRequestData.setMchId(temp[1]);
String
chanId
=
data
.
getChanId
();
payRequestData
.
setChanId
(
chanId
);
payRequestData
.
setOutTradeNo
(
data
.
getOutTradeNo
());
payRequestData
.
setAccountNo
(
data
.
getAccountNo
());
payRequestData
.
setSubject
(
data
.
getSubject
());
payRequestData
.
setAmount
(
data
.
getAmount
());
payRequestData
.
setNotifyUrl
(
"http://127.0.0.1:8080/notifyUrl"
);
payRequestData
.
setNotifyUrl
(
data
.
getNotifyUrl
()
);
AcquirerProperties
properties
=
check
(
payRequestData
);
ChannelResponse
response
=
transactionService
.
pay
(
properties
,
payRequestData
);
return
response
;
...
...
baa-pay-server/src/main/resources/templates/pay/h5.html
View file @
c8953b4c
...
...
@@ -174,7 +174,7 @@
</dt>
<dd>
<select
name=
"data[chan_id]"
>
<option
value=
"7577228561894630
7_wx2f44c7fe7b08458d
"
>
微信
</option>
<option
value=
"7577228561894630
9
"
>
微信
</option>
<option
value=
"75772285618946317_wxd678efh567hg6787"
>
支付宝
</option>
</select>
</dd>
...
...
@@ -206,6 +206,16 @@
<input
id=
"body"
name=
"data[body]"
/>
</dd>
<hr
class=
"one_line"
>
<dt>
openId:
</dt>
<dd>
<input
id=
"openId"
name=
"data[open_id]"
value=
"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
/>
</dd>
<hr
class=
"one_line"
>
<dt>
openId:
</dt>
<dd>
<input
id=
"notifyUrl"
name=
"data[notify_url]"
value=
"https://baa-pay-server-pay.liangkebang.net/debug/merchant/pay"
/>
</dd>
<hr
class=
"one_line"
>
<dt></dt>
<dd
id=
"btn-dd"
>
<span
class=
"new-btn-login-sp"
>
...
...
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