Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzpay
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzpay
提交
0a19d3dc
提交
0a19d3dc
编写于
9月 09, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持微信支付
上级
e352a8db
变更
5
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
110 行增加
和
228 行删除
+110
-228
PayTradeAspect.java
...ava/cn/ibizlab/core/extensions/aspect/PayTradeAspect.java
+2
-0
PayCoreService.java
...va/cn/ibizlab/core/extensions/service/PayCoreService.java
+78
-173
WechatPayConfig.java
...izlab/core/extensions/service/wechat/WechatPayConfig.java
+0
-45
WechatPayDomain.java
...izlab/core/extensions/service/wechat/WechatPayDomain.java
+13
-0
PayCoreResource.java
.../java/cn/ibizlab/api/rest/extensions/PayCoreResource.java
+17
-10
未找到文件。
ibzpay-core/src/main/java/cn/ibizlab/core/extensions/aspect/PayTradeAspect.java
浏览文件 @
0a19d3dc
...
...
@@ -32,7 +32,9 @@ public class PayTradeAspect {
Object
serviceParam
=
args
[
0
];
if
(
serviceParam
instanceof
PayTrade
){
PayTrade
entity
=(
PayTrade
)
serviceParam
;
entity
.
setTradeId
((
String
)
entity
.
getDefaultKey
(
true
));
entity
.
setTradeName
(
entity
.
getSubject
());
entity
.
setTradeStatus
(
"NOTPAY"
);
payTradeService
.
save
(
entity
);
}
}
...
...
ibzpay-core/src/main/java/cn/ibizlab/core/extensions/service/PayCoreService.java
浏览文件 @
0a19d3dc
此差异已折叠。
点击以展开。
ibzpay-core/src/main/java/cn/ibizlab/core/extensions/service/wechat/WechatPayConfig.java
浏览文件 @
0a19d3dc
package
cn
.
ibizlab
.
core
.
extensions
.
service
.
wechat
;
import
lombok.Data
;
import
java.io.ByteArrayInputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
@Data
...
...
@@ -22,44 +17,4 @@ public class WechatPayConfig extends WXPayConfig {
private
InputStream
certStream
;
private
IWXPayDomain
WXPayDomain
;
// public WechatPayConfig() throws Exception {
// String certPath = "/path/to/apiclient_cert.p12";
// File file = new File(certPath);
// InputStream certStream = new FileInputStream(file);
// this.certData = new byte[(int) file.length()];
// certStream.read(this.certData);
// certStream.close();
// }
//
// public String getAppID() {
// return "wx8888888888888888";
// }
//
// public String getMchID() {
// return "12888888";
// }
//
// public String getKey() {
// return "88888888888888888888888888888888";
// }
// public InputStream getCertStream() {
// ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
// return certBis;
// }
// public int getHttpConnectTimeoutMs() {
// return 8000;
// }
//
// public int getHttpReadTimeoutMs() {
// return 10000;
// }
// @Override
// IWXPayDomain getWXPayDomain() {
// return null;
// }
}
\ No newline at end of file
ibzpay-core/src/main/java/cn/ibizlab/core/extensions/service/wechat/WechatPayDomain.java
0 → 100644
浏览文件 @
0a19d3dc
package
cn
.
ibizlab
.
core
.
extensions
.
service
.
wechat
;
public
class
WechatPayDomain
implements
IWXPayDomain
{
@Override
public
void
report
(
String
domain
,
long
elapsedTimeMillis
,
Exception
ex
)
{
}
@Override
public
DomainInfo
getDomain
(
WXPayConfig
config
)
{
return
new
DomainInfo
(
"api.mch.weixin.qq.com"
,
true
);
}
}
ibzpay-provider/ibzpay-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/PayCoreResource.java
浏览文件 @
0a19d3dc
...
...
@@ -10,11 +10,10 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.constraints.NotBlank
;
@RestController
public
class
PayCoreResource
{
...
...
@@ -34,15 +33,23 @@ public class PayCoreResource {
}
@ApiOperation
(
value
=
"查询订单"
,
tags
=
{
"查询订单"
},
notes
=
"查询订单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/pay/trade/query"
)
public
ResponseEntity
<
JSONObject
>
query
(
@Validated
@RequestBody
PayTradeDTO
dto
){
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
payCoreService
.
query
(
payTradeMapping
.
toDomain
(
dto
)));
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/pay/trade/query"
)
public
ResponseEntity
<
JSONObject
>
query
(
@Validated
@NotBlank
(
message
=
"开放平台配置标识不允许为空"
)
@RequestParam
(
"accessid"
)
String
accessId
,
@NotBlank
(
message
=
"订单号不允许为空"
)
@RequestParam
(
"out_trade_no"
)
String
outTradeNo
){
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
payCoreService
.
query
(
accessId
,
outTradeNo
));
}
@ApiOperation
(
value
=
"取消订单"
,
tags
=
{
"取消订单"
},
notes
=
"取消订单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/pay/trade/cancel"
)
public
ResponseEntity
<
JSONObject
>
cancel
(
@Validated
@RequestBody
PayTradeDTO
dto
){
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
payCoreService
.
cancel
(
payTradeMapping
.
toDomain
(
dto
)));
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/pay/trade/cancel"
)
public
ResponseEntity
<
JSONObject
>
cancel
(
@Validated
@NotBlank
(
message
=
"开放平台配置标识不允许为空"
)
@RequestParam
(
"accessid"
)
String
accessId
,
@NotBlank
(
message
=
"订单号不允许为空"
)
@RequestParam
(
"out_trade_no"
)
String
outTradeNo
){
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
payCoreService
.
cancel
(
accessId
,
outTradeNo
));
}
@ApiOperation
(
value
=
"支付回调"
,
tags
=
{
"支付回调"
},
notes
=
"支付回调"
)
@RequestMapping
(
value
=
"/pay/trade/callback"
)
public
ResponseEntity
<
String
>
callBack
(
HttpServletRequest
req
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
payCoreService
.
callBack
(
req
));
}
@ApiOperation
(
value
=
"网页支付"
,
tags
=
{
"网页支付"
},
notes
=
"网页支付"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录