Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
youjj
cloud-platform
Commits
5420f6c9
Commit
5420f6c9
authored
Sep 29, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
1f661d79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
WXPay.java
...in/java/com/xxfc/platform/universal/weixin/api/WXPay.java
+8
-6
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+7
-1
No files found.
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/weixin/api/WXPay.java
View file @
5420f6c9
package
com
.
xxfc
.
platform
.
universal
.
weixin
.
api
;
package
com
.
xxfc
.
platform
.
universal
.
weixin
.
api
;
import
java.util.Map.Entry
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.Iterator
;
import
java.util.Iterator
;
...
@@ -16,13 +16,12 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
...
@@ -16,13 +16,12 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.xxfc.platform.universal.weixin.util.HTTPUtils
;
import
com.xxfc.platform.universal.weixin.util.HTTPUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.dom4j.Document
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
org.dom4j.DocumentHelper
;
import
org.dom4j.Element
;
import
org.dom4j.Element
;
import
org.dom4j.Node
;
import
org.dom4j.Node
;
import
org.dom4j.io.SAXReader
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
/**
/**
...
@@ -44,9 +43,12 @@ public class WXPay {
...
@@ -44,9 +43,12 @@ public class WXPay {
* @return
* @return
*/
*/
public
static
String
webPay
(
String
total_fee
,
String
body
,
String
notify_url
,
String
orderNo
,
String
spbill_create_ip
,
String
openid
){
public
static
String
webPay
(
String
total_fee
,
String
body
,
String
notify_url
,
String
orderNo
,
String
spbill_create_ip
,
String
openid
,
String
wyAppid
){
WXPrepay
prePay
=
new
WXPrepay
();
WXPrepay
prePay
=
new
WXPrepay
();
prePay
.
setAppid
(
SystemConfig
.
WINXIN_AppID
);
//pay.getAppId()
if
(
StringUtils
.
isBlank
(
wyAppid
)){
wyAppid
=
SystemConfig
.
WINXIN_AppID
;
}
prePay
.
setAppid
(
wyAppid
);
//pay.getAppId()
prePay
.
setBody
(
body
);
prePay
.
setBody
(
body
);
prePay
.
setPartnerKey
(
SystemConfig
.
WINXIN_PARTNER_KEY
);
//pay.getPartnerKey()
prePay
.
setPartnerKey
(
SystemConfig
.
WINXIN_PARTNER_KEY
);
//pay.getPartnerKey()
prePay
.
setMch_id
(
SystemConfig
.
WINXIN_PARTNER
);
//pay.getPartnerId()
prePay
.
setMch_id
(
SystemConfig
.
WINXIN_PARTNER
);
//pay.getPartnerId()
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
5420f6c9
...
@@ -63,6 +63,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -63,6 +63,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
MQServiceBiZ
mqServiceBiZ
;
MQServiceBiZ
mqServiceBiZ
;
@Value
(
"${universal.url}"
)
@Value
(
"${universal.url}"
)
String
weixinHost
;
String
weixinHost
;
@Value
(
"${wx.appid}"
)
private
String
wy_appid
;
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
...
@@ -102,13 +105,16 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -102,13 +105,16 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
String
sellerAccount
=
null
;
String
sellerAccount
=
null
;
if
(
type
==
2
&&
payWay
==
1
)
{
if
(
type
==
2
&&
payWay
==
1
)
{
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
jsParam
=
WXPay
.
webPay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
orderPayVo
.
getBuyerAccount
());
jsParam
=
WXPay
.
webPay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
orderPayVo
.
getBuyerAccount
()
,
null
);
}
else
if
(
type
==
1
&&
payWay
==
1
)
{
}
else
if
(
type
==
1
&&
payWay
==
1
)
{
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
}
else
if
(
type
==
1
&&
payWay
==
2
)
{
}
else
if
(
type
==
1
&&
payWay
==
2
)
{
sellerAccount
=
SystemConfig
.
ALIPAY_PID
;
sellerAccount
=
SystemConfig
.
ALIPAY_PID
;
jsParam
=
generateAliPayment
(
orderPayVo
,
notifyUrl
);
jsParam
=
generateAliPayment
(
orderPayVo
,
notifyUrl
);
}
else
if
(
type
==
3
&&
payWay
==
1
){
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
jsParam
=
WXPay
.
webPay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
orderPayVo
.
getBuyerAccount
(),
wy_appid
);
}
}
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
...
...
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