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
dcda5cee
Commit
dcda5cee
authored
Aug 06, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付宝支付
parent
e3d2e597
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+7
-7
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
dcda5cee
...
@@ -62,9 +62,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -62,9 +62,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
@Autowired
@Autowired
MQServiceBiZ
mqServiceBiZ
;
MQServiceBiZ
mqServiceBiZ
;
@Value
(
"${universal.url}"
)
@Value
(
"${universal.url}"
)
static
String
weixinHost
;
String
weixinHost
;
private
static
final
String
notifyUrl
=
weixinHost
+
"/api/universal/pay/app/unauth/notify/alipay"
;
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
...
@@ -97,6 +96,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -97,6 +96,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
Integer
type
=
orderPayVo
.
getType
()
==
null
?
1
:
orderPayVo
.
getType
();
Integer
type
=
orderPayVo
.
getType
()
==
null
?
1
:
orderPayVo
.
getType
();
String
jsParam
=
""
;
String
jsParam
=
""
;
String
notify_url
=
weixinHost
+
"/api/universal/pay/app/unauth/notify"
;
String
notify_url
=
weixinHost
+
"/api/universal/pay/app/unauth/notify"
;
String
notifyUrl
=
weixinHost
+
"/api/universal/pay/app/unauth/notify/alipay"
;
log
.
info
(
"报名费回调路径notify_url:"
+
notify_url
);
log
.
info
(
"报名费回调路径notify_url:"
+
notify_url
);
Integer
payWay
=
orderPayVo
.
getPayWay
()
==
null
?
1
:
orderPayVo
.
getPayWay
();
Integer
payWay
=
orderPayVo
.
getPayWay
()
==
null
?
1
:
orderPayVo
.
getPayWay
();
String
sellerAccount
=
null
;
String
sellerAccount
=
null
;
...
@@ -108,7 +108,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -108,7 +108,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
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
);
jsParam
=
generateAliPayment
(
orderPayVo
,
notifyUrl
);
}
}
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
...
@@ -276,7 +276,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -276,7 +276,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
* @return
* @return
*/
*/
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
private
String
generateAliPayment
(
OrderPayVo
orderPayVo
)
{
private
String
generateAliPayment
(
OrderPayVo
orderPayVo
,
String
notifyUrl
)
{
//实例化客户端
//实例化客户端
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
...
@@ -285,7 +285,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -285,7 +285,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
try
{
try
{
return
appOrderPay
(
alipayClient
,
orderPayVo
);
return
appOrderPay
(
alipayClient
,
orderPayVo
,
notifyUrl
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -294,7 +294,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -294,7 +294,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
}
}
//支付宝APP支付方法
//支付宝APP支付方法
public
String
appOrderPay
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
)
{
public
String
appOrderPay
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
,
String
notifyUrl
)
{
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
AlipayTradeAppPayRequest
request
=
new
AlipayTradeAppPayRequest
();
AlipayTradeAppPayRequest
request
=
new
AlipayTradeAppPayRequest
();
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
...
@@ -318,7 +318,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -318,7 +318,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//预授权冻结
//预授权冻结
public
String
fundAuthOrderAppFreeze
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
)
throws
AlipayApiException
{
public
String
fundAuthOrderAppFreeze
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
,
String
notifyUrl
)
throws
AlipayApiException
{
AlipayFundAuthOrderAppFreezeRequest
request
=
new
AlipayFundAuthOrderAppFreezeRequest
();
AlipayFundAuthOrderAppFreezeRequest
request
=
new
AlipayFundAuthOrderAppFreezeRequest
();
AlipayFundAuthOrderAppFreezeModel
model
=
new
AlipayFundAuthOrderAppFreezeModel
();
AlipayFundAuthOrderAppFreezeModel
model
=
new
AlipayFundAuthOrderAppFreezeModel
();
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
...
...
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