Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
037472e6
提交
037472e6
authored
11月 12, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
38ecd31c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
5 行删除
+12
-5
FlutterWaveServiceImpl.java
.../zion/chinafrica/service/impl/FlutterWaveServiceImpl.java
+11
-5
PayPalServiceImpl.java
...aoyun/zion/chinafrica/service/impl/PayPalServiceImpl.java
+1
-0
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/service/impl/FlutterWaveServiceImpl.java
浏览文件 @
037472e6
...
...
@@ -29,7 +29,6 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
sun.net.www.http.HttpClient
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
...
...
@@ -57,6 +56,7 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
private
RedisCache
<
Object
>
orderRedisCache
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
FlutterWaveServiceImpl
.
class
);
//退款API
private
String
FLUTTERWAVE_REFUND_URL
=
"https://api.ravepay.co/gpx/merchant/transactions/refund"
;
/**
...
...
@@ -73,6 +73,13 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
RaveConstant
.
ENVIRONMENT
=
Environment
.
STAGING
;
//or live
Result
result
=
new
Result
();
TbCfOrderVo
tbCfOrderVo
=
(
TbCfOrderVo
)
orderRedisCache
.
get
(
KeyConstant
.
ORDER_DET
+
orderId
);
TbCfOrderEntity
orderEntity
=
tbCfOrderDao
.
queryObject
(
orderId
);
//判断这个订单是否已支付
if
(
orderEntity
!=
null
&&
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
orderEntity
.
getPayStatus
()))
{
result
.
setMessage
(
"Order paid"
);
result
.
setCode
(
ResultCodeEnum
.
ORDER_PAY_ERROR
.
getCode
());
return
result
;
}
if
(
tbCfOrderVo
!=
null
)
{
try
{
String
orderPrice
=
tbCfOrderVo
.
getRealityPay
().
toString
();
...
...
@@ -89,10 +96,10 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
JSONObject
chargevisa
=
ch
.
chargeVisaAndIntl
();
//if timeout, poll
//JSONObject pollvisa = ch.chargeVisaAndIntl(true);
System
.
out
.
println
(
chargevisa
);
//
System.out.println(chargevisa);
net
.
sf
.
json
.
JSONObject
object
=
net
.
sf
.
json
.
JSONObject
.
fromObject
(
chargevisa
.
toString
());
String
status
=
object
.
getString
(
"status"
);
System
.
out
.
println
(
"========>>>"
+
status
);
//
System.out.println("========>>>" + status);
if
(
"success"
.
equals
(
status
))
{
net
.
sf
.
json
.
JSONObject
data
=
object
.
getJSONObject
(
"data"
);
String
paymentId
=
data
.
getString
(
"paymentId"
);
...
...
@@ -107,15 +114,14 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
TbCfFinanceEntity
finance
=
createFinance
(
paymentId
,
url
,
tbCfOrderVo
);
TbCfFinanceVo
tbCfFinanceVo
=
new
TbCfFinanceVo
();
BeanUtils
.
copyProperties
(
finance
,
tbCfFinanceVo
);
//清除订单
result
.
setData
(
chargevisa
).
setMessage
(
"Pay for success!"
);
logger
.
info
(
tbCfOrderVo
.
getUserName
()
+
":Pay for success! The order number is:"
+
tbCfOrderVo
.
getOrderId
());
//清除订单
removeRedisCache
(
tbCfOrderVo
);
}
else
{
result
.
setCode
(
ResultCodeEnum
.
ORDER_PAY_ERROR
.
getCode
()).
setMessage
(
"payment failure!"
);
logger
.
error
(
tbCfOrderVo
.
getUserName
()
+
":payment failure! The order number is:"
+
tbCfOrderVo
.
getOrderId
());
}
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
ORDER_PAY_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/PayPalServiceImpl.java
浏览文件 @
037472e6
...
...
@@ -76,6 +76,7 @@ public class PayPalServiceImpl implements PayPalService {
PayService
service
=
new
PayPalPayService
(
storage
);
TbCfOrderVo
tbCfOrderVo
=
(
TbCfOrderVo
)
orderRedisCache
.
get
(
KeyConstant
.
ORDER_DET
+
orderId
);
TbCfOrderEntity
orderEntity
=
tbCfOrderDao
.
queryObject
(
orderId
);
//判断这个订单是否已支付
if
(
orderEntity
!=
null
&&
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
orderEntity
.
getPayStatus
()))
{
result
.
setMessage
(
"Order paid"
);
result
.
setCode
(
ResultCodeEnum
.
ORDER_PAY_ERROR
.
getCode
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论