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
b21d4cd0
Commit
b21d4cd0
authored
Oct 24, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付宝支付转为预授权
parent
f05baad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
36 deletions
+14
-36
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+14
-36
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
b21d4cd0
...
@@ -216,22 +216,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -216,22 +216,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
valueStr
=
(
i
==
values
.
length
-
1
)
?
valueStr
+
values
[
i
]
valueStr
=
(
i
==
values
.
length
-
1
)
?
valueStr
+
values
[
i
]
:
valueStr
+
values
[
i
]
+
","
;
:
valueStr
+
values
[
i
]
+
","
;
}
}
log
.
info
(
valueStr
);
//乱码解决,这段代码在出现乱码时使用。
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
params
.
put
(
name
,
valueStr
);
params
.
put
(
name
,
valueStr
);
}
}
String
msg
=
JSONObject
.
toJSONString
(
params
);
String
msg
=
JSONObject
.
toJSONString
(
params
);
log
.
info
(
"alipay notify message={}"
,
msg
);
log
.
info
(
"alipay notify message={}"
,
msg
);
//添加回调记录
// PaymentCallbackLog callbackLog = new PaymentCallbackLog();
// callbackLog.setPayCode(rstradeNo);
// callbackLog.setPayType(SystemConstant.PayType.ALIPAY);
// callbackLog.setOrderCode(rsOrderCode);
// callbackLog.setMessage(msg);
// paymentCallbackLogRepository.save(callbackLog);
// 切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。
// boolean AlipaySignature.rsaCheckV1(Map<String, String> params, String publicKey, String charset, String sign_type)
//支付宝回调验签
//支付宝回调验签
try
{
try
{
boolean
flag
=
AlipaySignature
.
rsaCheckV1
(
params
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
CHARSET_UTF8
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
boolean
flag
=
AlipaySignature
.
rsaCheckV1
(
params
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
CHARSET_UTF8
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
...
@@ -240,36 +228,26 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -240,36 +228,26 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
}
String
rsTradeStatus
=
params
.
get
(
"trade_status"
);
String
rsTradeStatus
=
params
.
get
(
"trade_status"
);
if
(!
SystemConfig
.
ALIPAY_TRADE_FINISHED
.
equals
(
rsTradeStatus
)
&&
!
SystemConfig
.
ALIPAY_TRADE_SUCCESS
.
equals
(
rsTradeStatus
))
{
if
(
StringUtils
.
isBlank
(
rsTradeStatus
))
{
//订单预授权支付回调
String
status
=
params
.
get
(
"status"
);
if
(!
status
.
equals
(
"SUCCESS"
))
{
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
//订单APP支付回调
}
else
if
(!
SystemConfig
.
ALIPAY_TRADE_FINISHED
.
equals
(
rsTradeStatus
)
&&
!
SystemConfig
.
ALIPAY_TRADE_SUCCESS
.
equals
(
rsTradeStatus
))
{
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
}
//String rsSellerId = params.get("seller_id");
//
// PaymentRecord paymentRecord = paymentRecordRepository.findOneByOrderCode(rsOrderCode);
// //验证付款信息
// if (paymentRecord == null || !paymentRecord.getAmount().toString().equals(rsAmount)
// || !aliPayConfig.getAppId().equals(rsAppId)) {
// log.info("alipay order notify fail, result={}", msg);
// return Response.FAILURE.getHeader().getMessage();
// }
// //重复回调
// if (paymentRecord.getStatus().intValue() != 1) {
// log.info("alipay order repeat notify, result={}", msg);
// return Response.SUCCESS().getHeader().getMessage();
// }
//
// paymentRecord.setPayCode(rstradeNo);
// paymentRecord.setStatus(2);
// paymentRecordRepository.save(paymentRecord);
// Map<String, Object> sendMap = DataUtils.objectToMap(paymentRecord);
// sendMap.put("amount", new BigDecimal(rsAmount).multiply(new BigDecimal(100)).intValue());
// sendMsgToOrder(JSONObject.toJSONString(sendMap));
String
tradeNo
=
params
.
get
(
"out_trade_no"
);
String
tradeNo
=
params
.
get
(
"out_trade_no"
);
if
(
StringUtils
.
isBlank
(
tradeNo
))
{
tradeNo
=
params
.
get
(
"out_request_no"
);
}
String
operationId
=
params
.
get
(
"trade_no"
);
String
operationId
=
params
.
get
(
"trade_no"
);
if
(
StringUtils
.
isBlank
(
operationId
))
{
operationId
=
params
.
get
(
"auth_no"
);
}
notice
(
tradeNo
,
operationId
);
notice
(
tradeNo
,
operationId
);
return
ObjectRestResponse
.
succ
().
getMessage
();
return
ObjectRestResponse
.
succ
().
getMessage
();
}
catch
(
AlipayApiException
e
)
{
}
catch
(
AlipayApiException
e
)
{
...
...
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