Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
8d3995c0
Commit
8d3995c0
authored
Aug 29, 2017
by
jmdhappy
Browse files
完善微信APP和JSAPI支付
parent
cc3b20aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
xxpay-shop/src/main/resources/templates/qrPay.ftl
View file @
8d3995c0
...
...
@@ -40,7 +40,7 @@
W
eixinJSBridge
.invoke
(
'
getBrandWCPayRequest
'
,
{
"appId"
:
"${orderMap.payParams.appId}"
,
//公众号名称,由商户传入
"timeStamp"
:
"${orderMap.payParams.timeStamp
?c
}"
,
//时间戳,自
1970
年以来的秒数
"timeStamp"
:
"${orderMap.payParams.timeStamp}"
,
//时间戳,自
1970
年以来的秒数
"nonceStr"
:
"${orderMap.payParams.nonceStr}"
,
//随机串
"package"
:
"${orderMap.payParams.package}"
,
"signType"
:
"${orderMap.payParams.signType}"
,
//微信签名方式:
...
...
xxpay4spring-cloud/xxpay-service/src/main/java/org/xxpay/service/controller/PayChannel4WxController.java
View file @
8d3995c0
...
...
@@ -93,36 +93,15 @@ public class PayChannel4WxController{
break
;
}
case
PayConstant
.
WxConstant
.
TRADE_TYPE_APP
:
{
Map
<
String
,
Object
>
m
=
new
HashMap
<>();
m
.
put
(
"appid"
,
wxPayUnifiedOrderResult
.
getAppid
());
m
.
put
(
"partnerid"
,
wxPayUnifiedOrderResult
.
getMchId
());
m
.
put
(
"prepayid"
,
wxPayUnifiedOrderResult
.
getPrepayId
());
m
.
put
(
"package"
,
"Sign=WXPay"
);
m
.
put
(
"noncestr"
,
wxPayUnifiedOrderResult
.
getNonceStr
());
m
.
put
(
"timestamp"
,
System
.
currentTimeMillis
()/
1000
);
String
wxSign
=
SignUtils
.
createSign
(
m
,
wxPayConfig
.
getMchKey
());
m
.
put
(
"sign"
,
wxSign
);
map
.
put
(
"payParams"
,
m
);
map
.
put
(
"payPrice"
,
payOrder
.
getAmount
());
map
.
put
(
"payParams"
,
wxPayService
.
getPayInfo
(
wxPayUnifiedOrderRequest
));
break
;
}
case
PayConstant
.
WxConstant
.
TRADE_TYPE_JSPAI
:
{
Map
<
String
,
Object
>
m
=
new
HashMap
<>();
m
.
put
(
"appId"
,
wxPayConfig
.
getAppId
());
m
.
put
(
"timeStamp"
,
System
.
currentTimeMillis
()/
1000
);
m
.
put
(
"nonceStr"
,
wxPayUnifiedOrderResult
.
getNonceStr
());
m
.
put
(
"package"
,
"prepay_id="
+
wxPayUnifiedOrderResult
.
getPrepayId
());
m
.
put
(
"signType"
,
"MD5"
);
String
wxSign
=
SignUtils
.
createSign
(
m
,
wxPayConfig
.
getMchKey
());
m
.
put
(
"paySign"
,
wxSign
);
map
.
put
(
"payParams"
,
m
);
map
.
put
(
"payPrice"
,
payOrder
.
getAmount
());
map
.
put
(
"payParams"
,
wxPayService
.
getPayInfo
(
wxPayUnifiedOrderRequest
));
break
;
}
case
PayConstant
.
WxConstant
.
TRADE_TYPE_MWEB
:
{
Map
<
String
,
Object
>
m
=
new
HashMap
<>();
map
.
put
(
"payUrl"
,
wxPayUnifiedOrderResult
.
getMwebUrl
());
// h5支付链接地址
map
.
put
(
"payPrice"
,
payOrder
.
getAmount
());
break
;
}
}
...
...
Write
Preview
Supports
Markdown
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