记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
8d64c802
Commit
8d64c802
authored
Apr 11, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apple 查询订单。
parent
79ce155f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
ApplepayImpl.java
...et/service/dragon/channel/strategy/impl/ApplepayImpl.java
+20
-27
No files found.
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/ApplepayImpl.java
View file @
8d64c802
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
strategy
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.biz.DragonServiceCommonBiz
;
import
com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.AlipayStrategyContext
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
import
com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
...
...
@@ -11,11 +9,10 @@ import com.liquidnet.service.dragon.dto.DragonOrdersDto;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto
;
import
com.liquidnet.service.dragon.service.impl.DragonOrder
Refund
sServiceImpl
;
import
com.liquidnet.service.dragon.service.impl.DragonOrdersServiceImpl
;
import
com.liquidnet.service.dragon.utils.DataUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -32,38 +29,18 @@ import java.time.LocalDateTime;
*/
@Slf4j
@Component
@StrategyPayChannelHandler
(
DragonConstant
.
PayChannelEnum
.
A
LI
PAY
)
@StrategyPayChannelHandler
(
DragonConstant
.
PayChannelEnum
.
A
PPLE
PAY
)
public
class
ApplepayImpl
extends
AbstractPayChannelStrategyImpl
{
@Autowired
private
AlipayStrategyContext
alipayStrategyContext
;
@Autowired
private
DataUtils
dataUtils
;
@Autowired
private
AlipayBiz
alipayBiz
;
private
DragonOrdersServiceImpl
dragonOrdersService
;
@Autowired
private
DragonPayBiz
dragonPayBiz
;
@Autowired
private
DragonServiceCommonBiz
dragonServiceCommonBiz
;
@Autowired
private
DragonOrderRefundsServiceImpl
dragonOrderRefundsService
;
@Value
(
"${liquidnet.dragon.alipay.appId}"
)
private
String
appId
;
@Value
(
"${liquidnet.dragon.alipay.merchantPubKey}"
)
private
String
merchantPubKey
;
@Value
(
"${liquidnet.dragon.alipay.merchantPrivateKey}"
)
private
String
merchantPrivateKey
;
@Value
(
"${liquidnet.dragon.alipay.signtType}"
)
private
String
signtType
;
@Value
(
"${liquidnet.dragon.alipay.charset}"
)
private
String
charset
;
public
void
completeSuccessOrder
(
DragonOrdersDto
dragonOrdersDto
,
String
code
,
String
result
){
this
.
completeSuccessOrderNoNotify
(
dragonOrdersDto
,
code
,
LocalDateTime
.
now
(),
result
);
}
...
...
@@ -80,6 +57,22 @@ public class ApplepayImpl extends AbstractPayChannelStrategyImpl {
@Override
public
DragonPayOrderQueryRespDto
checkOrderStatus
(
String
code
)
{
DragonOrdersDto
ordersDto
=
dataUtils
.
getPayOrderByCode
(
code
);
//调用 苹果效验
String
verifyResult
=
dragonOrdersService
.
buyAppVerify
(
ordersDto
.
getReceiptData
());
if
(
verifyResult
==
null
)
{
// 苹果服务器没有返回验证结果
log
.
info
(
"苹果支付查询(checkOrderStatus),查不到订单信息"
);
return
null
;
}
else
{
JSONObject
job
=
JSONObject
.
parseObject
(
verifyResult
);
String
states
=
job
.
getString
(
"status"
);
if
(
states
.
equals
(
"0"
))
{
// 前端所提供的收据是有效的 验证成功
DragonPayOrderQueryRespDto
respDto
=
dragonPayBiz
.
buildPayOrderQueryRespDto
(
ordersDto
);
respDto
.
setStatus
(
Integer
.
valueOf
(
DragonConstant
.
PayStatusEnum
.
STATUS_PAID
.
getCode
()));
return
respDto
;
}
}
return
null
;
}
}
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