Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
8f60e4ee
提交
8f60e4ee
authored
11月 11, 2023
作者:
huningning
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加违约支付
上级
b2921e4a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
64 行增加
和
0 行删除
+64
-0
PayNotifyController.java
...x/performance/controller/payment/PayNotifyController.java
+18
-0
PaymentService.java
...main/java/com/clx/performance/service/PaymentService.java
+2
-0
PaymentServiceImpl.java
.../com/clx/performance/service/impl/PaymentServiceImpl.java
+44
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/controller/payment/PayNotifyController.java
浏览文件 @
8f60e4ee
...
@@ -42,4 +42,22 @@ public class PayNotifyController {
...
@@ -42,4 +42,22 @@ public class PayNotifyController {
return
ret
;
return
ret
;
}
}
@ApiOperation
(
value
=
"用户支付完成回调接口"
,
notes
=
" <br>By:胡宁宁"
)
@RequestMapping
(
value
=
"/userPayBrokerContractNotify"
,
method
=
RequestMethod
.
POST
)
public
Result
<
Object
>
userPayBrokerContractNotify
(
@RequestBody
NotifyString
notify
)
{
log
.
info
(
"用户支付完成回调接口 传参 {}"
,
notify
);
if
(
Objects
.
isNull
(
notify
)
||
Objects
.
isNull
(
notify
.
getCode
())
||
Objects
.
isNull
(
notify
.
getAction
()))
{
return
new
Result
<>();
}
if
(
notify
.
getCode
()
!=
0
)
{
// 支付失败处理
log
.
info
(
"支付失败处理 唯一id {}"
,
notify
.
getOrderNo
());
}
else
{
// 支付支付成功处理
log
.
info
(
" 支付支付成功处理 唯一id {}"
,
notify
.
getOrderNo
());
}
Result
<
Object
>
ret
=
new
Result
<>();
return
ret
;
}
}
}
performance-web/src/main/java/com/clx/performance/service/PaymentService.java
浏览文件 @
8f60e4ee
...
@@ -7,4 +7,6 @@ import com.msl.common.result.Result;
...
@@ -7,4 +7,6 @@ import com.msl.common.result.Result;
public
interface
PaymentService
{
public
interface
PaymentService
{
Result
paymentWallet
(
PayParam
noCheckPwd
);
Result
paymentWallet
(
PayParam
noCheckPwd
);
Result
paymentBreakContractWallet
(
PayParam
noCheckPwd
);
}
}
performance-web/src/main/java/com/clx/performance/service/impl/PaymentServiceImpl.java
浏览文件 @
8f60e4ee
...
@@ -46,6 +46,9 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -46,6 +46,9 @@ public class PaymentServiceImpl implements PaymentService {
/** 转账回调地址 **/
/** 转账回调地址 **/
public
static
final
String
NOTIFY_URL
=
"/clx-performance/payment/notify/userPayNotify"
;
public
static
final
String
NOTIFY_URL
=
"/clx-performance/payment/notify/userPayNotify"
;
/** 违约回调地址 **/
public
static
final
String
NOTIFY_BROKER_URL
=
"/clx-performance/payment/notify/userPayBrokerContractNotify"
;
@Autowired
@Autowired
private
final
MslPaymentConfig
mslPaymentConfig
;
private
final
MslPaymentConfig
mslPaymentConfig
;
...
@@ -95,6 +98,47 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -95,6 +98,47 @@ public class PaymentServiceImpl implements PaymentService {
}
}
/**
* 钱包直接划账给钱包(违约)
*
* @param payDTO
* @return
*/
@Override
public
Result
paymentBreakContractWallet
(
PayParam
payDTO
)
{
/** 构建支付单元 **/
PayUnitDTO
payUnitDTO
=
PayUnitDTO
.
builder
()
.
id
(
payDTO
.
getTradeId
())
.
from
(
payDTO
.
getFrom
())
.
to
(
payDTO
.
getTo
())
.
figure
(
payDTO
.
getFigure
())
.
type
(
PayUnitTypeEnum
.
RESIDUE_PAY
.
getCode
())
.
timestamp
(
System
.
currentTimeMillis
()
/
1000
)
.
remark
(
payDTO
.
getRemark
()).
build
();
/** 生成签名**/
PayEncryptTools
.
sign
(
payUnitDTO
,
PrivateKeyConfig
.
privateKeyByte
);
/** 构建支付支付 ***/
PayUserDTO
payUserDTO
=
PayUserDTO
.
builder
()
.
pwd
(
payDTO
.
getPwd
())
.
system
(
SystemCodeEnum
.
PERFORMANCE_SERVICE
.
getCode
())
.
userCode
(
payDTO
.
getFrom
())
.
orderNo
(
payDTO
.
getTradeNo
())
.
uuid
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
))
.
notifyUrl
(
mslPaymentConfig
.
getNotifyhost
()
+
NOTIFY_BROKER_URL
)
.
payUnitDTO
(
payUnitDTO
).
build
();
log
.
info
(
"发起支付请求日志 {}"
,
payUserDTO
);
Result
<
Object
>
notify
=
(
Result
<
Object
>)
postRequest
(
mslPaymentConfig
.
getHost
()+
PERFORMANCE_PAY_CLX_PAYMENT
.
getUrl
(),
JSON
.
toJSONString
(
payUserDTO
));
log
.
info
(
"支付返回日志 {}"
,
notify
);
if
(
notify
==
null
||
notify
.
getCode
()
!=
0
)
{
//FEGIN返回null
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"支付服务返回异常"
);
}
return
notify
;
}
/**
/**
* post请求
* post请求
*/
*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论