Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
a6b686ef
提交
a6b686ef
authored
11月 19, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update dpo
上级
64f4033f
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
221 行增加
和
153 行删除
+221
-153
DpoPayController.java
...com/example/afrishop_v3/controllers/DpoPayController.java
+139
-91
FlutterWaveController.java
...xample/afrishop_v3/controllers/FlutterWaveController.java
+1
-1
TbCfUserInfo.java
...ain/java/com/example/afrishop_v3/models/TbCfUserInfo.java
+2
-0
WebSecurityConfig.java
...a/com/example/afrishop_v3/security/WebSecurityConfig.java
+1
-1
AuthenticationUser.java
...ple/afrishop_v3/security/services/AuthenticationUser.java
+13
-5
application-dev.yml
src/main/resources/application-dev.yml
+24
-19
application-prod.yml
src/main/resources/application-prod.yml
+12
-6
application-test.yml
src/main/resources/application-test.yml
+12
-13
application.properties
src/main/resources/application.properties
+2
-2
AfrishopV3ApplicationTests.java
...a/com/example/afrishop_v3/AfrishopV3ApplicationTests.java
+15
-15
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/DpoPayController.java
浏览文件 @
a6b686ef
...
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -47,111 +48,159 @@ public class DpoPayController extends Controller {
this
.
config
=
config
;
}
@GetMapping
(
"/notify/web"
)
public
void
payNotifyWeb
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
// Result result = new Result();
// try {
System
.
out
.
println
(
"DPO支付回调"
);
//订单号
String
orderId
=
request
.
getParameter
(
"CompanyRef"
);
//交易ID
String
transId
=
request
.
getParameter
(
"TransID"
);
//交易令牌
String
transToken
=
request
.
getParameter
(
"TransactionToken"
);
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
//logger.info("DPO支付:" + "开始支付校验");
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
String
orderSource
=
null
;
if
(
byId
.
isPresent
())
{
orderSource
=
byId
.
get
().
getOrderSource
().
toString
();
}
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
if
(
verifyPay
)
{
//logger.info("DPO支付:" + "支付校验成功");
// result.setMessage("Pay for success");
// result.setCode(ResultCodeEnum.SUCCESS.getCode());
response
.
sendRedirect
(
config
.
getSuccessUrl
());
}
else
{
response
.
sendRedirect
(
config
.
getFailedUrl
());
@GetMapping
(
"/notify"
)
public
Result
payNotify
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Result
result
=
new
Result
();
try
{
System
.
out
.
println
(
"DPO支付回调"
);
//订单号
String
orderId
=
request
.
getParameter
(
"CompanyRef"
);
//交易ID
String
transId
=
request
.
getParameter
(
"TransID"
);
//交易令牌
String
transToken
=
request
.
getParameter
(
"TransactionToken"
);
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
//logger.info("DPO支付:" + "开始支付校验");
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
if
(
verifyPay
)
{
//logger.info("DPO支付:" + "支付校验成功");
result
.
setMessage
(
"Pay for success"
);
result
.
setCode
(
ResultCodeEnum
.
SUCCESS
.
getCode
());
return
result
;
}
}
return
new
Result
<>(
result
,
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
(),
"Pay for failure"
);
}
// } catch (Exception e) {
// return new Result<>(result,ResultCodeEnum.SERVICE_ERROR.getCode(), "Pay for failure");
// //logger.error("DPO支付回调发生异常--->>>" + e.toString());
// }
}
@GetMapping
(
"/notify"
)
public
void
payNotify
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
// Result result = new Result();
// try {
System
.
out
.
println
(
"DPO支付回调"
);
//订单号
String
orderId
=
request
.
getParameter
(
"CompanyRef"
);
//交易ID
String
transId
=
request
.
getParameter
(
"TransID"
);
//交易令牌
String
transToken
=
request
.
getParameter
(
"TransactionToken"
);
System
.
err
.
println
(
"transID:"
+
transId
);
System
.
err
.
println
(
"transToken:"
+
transToken
);
//logger.info("DPO支付:" + "开始支付校验");
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
String
orderSource
=
null
;
if
(
byId
.
isPresent
())
{
orderSource
=
byId
.
get
().
getOrderSource
().
toString
();
}
if
(!
StringUtils
.
isBlank
(
orderId
)
&&
!
StringUtils
.
isBlank
(
transToken
))
{
boolean
verifyPay
=
verifyPay
(
transToken
,
orderId
);
if
(
verifyPay
)
{
//logger.info("DPO支付:" + "支付校验成功");
// result.setMessage("Pay for success");
// result.setCode(ResultCodeEnum.SUCCESS.getCode());
response
.
sendRedirect
(
config
.
getMobileSuccessUrl
());
}
else
{
response
.
sendRedirect
(
config
.
getMobileSuccessUrl
());
}
catch
(
Exception
e
)
{
return
new
Result
<>(
result
,
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
(),
"Pay for failure"
);
//logger.error("DPO支付回调发生异常--->>>" + e.toString());
}
}
// } catch (Exception e) {
// return new Result<>(result,ResultCodeEnum.SERVICE_ERROR.getCode(), "Pay for failure");
// //logger.error("DPO支付回调发生异常--->>>" + e.toString());
// }
}
@Transactional
public
boolean
verifyPay
(
String
transToken
,
String
orderId
)
{
boolean
verify
=
false
;
try
{
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
//
try {
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
if
(
!
byId
.
isPresent
()
)
return
false
;
if
(!
byId
.
isPresent
()
)
return
false
;
TbCfOrder
order
=
byId
.
get
();
TbCfOrder
order
=
byId
.
get
();
//如果数据库订单支付状态为20,说明已支付
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
()))
{
verify
=
true
;
return
true
;
}
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
//拼接xml格式的参数,发送请求
Map
<
String
,
Object
>
map
=
getParameters
(
transToken
);
String
mapToXml
=
DataUtils
.
multilayerMapToXml
(
map
,
false
);
mapToXml
=
mapToXml
.
replaceAll
(
"<xml>"
,
""
).
replaceAll
(
"</xml>"
,
""
);
String
resp
=
(
String
)
HttpsUtil
.
sendHttps
(
config
.
getPaymentApi
(),
"POST"
,
mapToXml
,
false
);
if
(
resp
!=
null
)
{
//将响应结果转成json格式
String
json
=
DataUtils
.
xml2json
(
resp
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
JSONObject
api3G
=
jsonObject
.
getJSONObject
(
"API3G"
);
String
resCode
=
api3G
.
getString
(
"Result"
);
//校验交易状态码
if
(
config
.
getSuccessCode
().
equals
(
resCode
))
{
TbCfUserInfo
user
=
this
.
user
.
user
();
if
(
user
.
hasFcm
()
){
//如果数据库订单支付状态为20,说明已支付
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
()))
{
verify
=
true
;
return
true
;
}
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
//拼接xml格式的参数,发送请求
Map
<
String
,
Object
>
map
=
getParameters
(
transToken
);
String
mapToXml
=
DataUtils
.
multilayerMapToXml
(
map
,
false
);
mapToXml
=
mapToXml
.
replaceAll
(
"<xml>"
,
""
).
replaceAll
(
"</xml>"
,
""
);
String
resp
=
(
String
)
HttpsUtil
.
sendHttps
(
config
.
getPaymentApi
(),
"POST"
,
mapToXml
,
false
);
if
(
resp
!=
null
)
{
//将响应结果转成json格式
String
json
=
DataUtils
.
xml2json
(
resp
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
JSONObject
api3G
=
jsonObject
.
getJSONObject
(
"API3G"
);
String
resCode
=
api3G
.
getString
(
"Result"
);
//校验交易状态码
if
(
config
.
getSuccessCode
().
equals
(
resCode
))
{
TbCfUserInfo
user
=
this
.
user
.
user
();
System
.
out
.
println
(
"this.user==========="
+
this
.
user
);
System
.
out
.
println
(
"user================"
+
user
);
if
(
user
!=
null
&&
user
.
hasFcm
())
{
sendNotification
(
user
.
getFcm
(),
"Order alert !!"
,
"Order of $"
+
order
.
getRealityPay
()
+
" has been successfully paid !!"
);
}
//获取缓存中的订单
//获取缓存中的订单
// TbCfOrderVo tbCfOrderVo = (TbCfOrderVo) orderRedisCache.get(KeyConstant.ORDER_DET + orderId);
// //如果缓存中没有订单,则从数据库中查找
// if (tbCfOrderVo == null) {
// tbCfOrderVo = tbCfOrderDao.queryObject(orderId);
// }
/**
* 处理支付成功的业务:更新订单,优惠券状态,生成支付明细
*/
//1.更新订单状态
changeOrderState
(
transToken
,
order
);
//2.更新优惠券状态
/**
* 处理支付成功的业务:更新订单,优惠券状态,生成支付明细
*/
//1.更新订单状态
changeOrderState
(
transToken
,
order
);
//2.更新优惠券状态
/*if (!StringUtils.isBlank(tbCfOrderVo.getCouponId())) {
tbCfToiCouponDao.changeCoupnStatus(tbCfOrderVo.getUserId(), tbCfOrderVo.getCouponId());
}*/
//3.生成支付明细
String
authurl
=
config
.
getRedirectUrl
()
+
"?ID="
+
transToken
;
TbCfFinance
finance
=
createFinance
(
transToken
,
authurl
,
order
);
//3.生成支付明细
String
authurl
=
config
.
getRedirectUrl
()
+
"?ID="
+
transToken
;
TbCfFinance
finance
=
createFinance
(
transToken
,
authurl
,
order
);
// TbCfFinanceVo tbCfFinanceVo = new TbCfFinanceVo();
// BeanUtils.copyProperties(finance, tbCfFinanceVo);
//校验数据库中订单支付状态
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
()))
{
//支付成功
logger
.
info
(
"DPO支付:订单号"
+
orderId
+
"支付成功,支付时间:"
+
dateFormat
.
format
(
new
Date
()));
verify
=
true
;
//清除缓存中的订单
// removeRedisCache(tbCfOrderVo);
}
}
if
(!
verify
)
{
logger
.
error
(
"DPO支付:订单号"
+
orderId
+
"支付失败,支付时间:"
+
dateFormat
.
format
(
new
Date
()));
logger
.
error
(
"DPO支付:状态码--->>>"
+
resCode
);
//校验数据库中订单支付状态
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
()))
{
//支付成功
logger
.
info
(
"DPO支付:订单号"
+
orderId
+
"支付成功,支付时间:"
+
dateFormat
.
format
(
new
Date
()));
verify
=
true
;
//清除缓存中的订单
// removeRedisCache(tbCfOrderVo);
}
}
if
(!
verify
)
{
logger
.
error
(
"DPO支付:订单号"
+
orderId
+
"支付失败,支付时间:"
+
dateFormat
.
format
(
new
Date
()));
logger
.
error
(
"DPO支付:状态码--->>>"
+
resCode
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"DPO支付:订单号"
+
orderId
+
"支付异常--->>>"
+
e
.
toString
());
}
// } catch (Exception e) {
// logger.error("DPO支付:订单号" + orderId + "支付异常--->>>" + e.toString());
// }
return
verify
;
}
...
...
@@ -185,18 +234,18 @@ public class DpoPayController extends Controller {
public
Result
payment
(
@RequestParam
(
"orderId"
)
String
orderId
)
{
if
(
orderId
==
null
||
orderId
.
trim
().
isEmpty
())
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Parameters cannot be empty"
);
if
(
orderId
==
null
||
orderId
.
trim
().
isEmpty
())
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Parameters cannot be empty"
);
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
if
(!
byId
.
isPresent
())
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Order not found !"
);
if
(!
byId
.
isPresent
())
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Order not found !"
);
TbCfOrder
order
=
byId
.
get
();
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
())
)
{
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Order has been paid !"
);
if
(
OrderStatusEnum
.
PAID
.
getValue
().
equals
(
order
.
getPayStatus
())
)
{
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Order has been paid !"
);
}
...
...
@@ -206,7 +255,7 @@ public class DpoPayController extends Controller {
if
(!
amountFlag
)
{
// logger.error("DPO支付:订单号" + orderId + "传入的金额有误");
// payErrorInfo(result, "Wrong order amount");
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Wrong order amount"
);
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Wrong order amount"
);
}
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
//logger.info("DPO支付:订单号" + orderId + "创建交易,交易时间:" + dateFormat.format(new Date()));
...
...
@@ -223,20 +272,20 @@ public class DpoPayController extends Controller {
String
resCode
=
api3G
.
getString
(
"Result"
);
String
transToken
=
api3G
.
getString
(
"TransToken"
);
if
(
config
.
getSuccessCode
().
equals
(
resCode
))
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"transToken"
,
transToken
);
resultMap
.
put
(
"payUrl"
,
config
.
getRedirectUrl
()
+
"?ID="
+
transToken
);
resultMap
.
put
(
"orderInfo"
,
order
);
// result.setData(resultMap);
// logger.info("DPO支付:订单号" + orderId + "创建令牌成功");
return
new
Result
<>(
resultMap
,
"Pay success"
);
return
new
Result
<>(
resultMap
,
"Pay success"
);
}
// logger.info("DPO支付:订单号" + orderId + "创建令牌失败,状态码:" + resCode);
// payErrorInfo(result, "DPO支付:订单号" + orderId + "创建令牌失败,状态码:" + resCode);
}
return
new
Result
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
(),
"DPO支付:订单号"
+
orderId
+
"创建令牌失败,状态码:"
);
return
new
Result
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
(),
"DPO支付:订单号"
+
orderId
+
"创建令牌失败,状态码:"
);
}
private
Map
<
String
,
Object
>
getParameters
(
String
transToken
)
{
...
...
@@ -259,13 +308,12 @@ public class DpoPayController extends Controller {
tranMap
.
put
(
"PaymentCurrency"
,
"USD"
);
tranMap
.
put
(
"CompanyRef"
,
order
.
getOrderId
());
tranMap
.
put
(
"CompanyRefUnique"
,
0
);
logger
.
info
(
"getOrderSource---------->>>>>>>>>>>>"
+
order
.
getOrderSource
());
//回调地址
if
(
order
.
getOrderSource
()
!=
null
&&
"1"
.
equals
(
order
.
getOrderSource
().
toString
()))
{
tranMap
.
put
(
"RedirectURL"
,
config
.
getNotifyUrl
());
}
else
if
(
order
.
getOrderSource
()
!=
null
&&
"2"
.
equals
(
order
.
getOrderSource
().
toString
()))
{
if
(
order
.
getOrderSource
()
!=
null
&&
"2"
.
equals
(
order
.
getOrderSource
().
toString
()))
{
tranMap
.
put
(
"RedirectURL"
,
config
.
getNotifyUrl
()
+
"/web"
);
}
else
if
(
order
.
getOrderSource
()
!=
null
&&
"3"
.
equals
(
order
.
getOrderSource
().
toString
()))
{
tranMap
.
put
(
"RedirectURL"
,
config
.
getNotifyUrl
()
+
"/mobile"
);
}
else
{
tranMap
.
put
(
"RedirectURL"
,
config
.
getNotifyUrl
());
}
System
.
out
.
println
(
"回调地址:"
+
tranMap
.
get
(
"RedirectURL"
));
//取消地址
...
...
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
a6b686ef
...
...
@@ -72,7 +72,7 @@ public class FlutterWaveController extends Controller {
public
ResponseEntity
<
String
>
payForOrderByCard
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestBody
FlutterWaveCard
flutterWaveCard
)
{
RaveConstant
.
PUBLIC_KEY
=
PUBLIC_KEY
;
RaveConstant
.
SECRET_KEY
=
SECRET_KEY
;
RaveConstant
.
ENVIRONMENT
=
Environment
.
LIVE
;
//or live
RaveConstant
.
ENVIRONMENT
=
Environment
.
STAGING
;
//or live
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
...
...
src/main/java/com/example/afrishop_v3/models/TbCfUserInfo.java
浏览文件 @
a6b686ef
...
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.hibernate.annotations.Formula
;
import
org.hibernate.annotations.NotFound
;
import
org.hibernate.annotations.NotFoundAction
;
...
...
@@ -21,6 +22,7 @@ import java.util.*;
* @author lipengjun
* @date 2020-02-20 12:04:18
*/
@ToString
@Entity
@Getter
@Setter
...
...
src/main/java/com/example/afrishop_v3/security/WebSecurityConfig.java
浏览文件 @
a6b686ef
...
...
@@ -65,7 +65,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http
.
cors
().
and
().
csrf
().
disable
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
sessionManagement
().
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
).
and
()
.
authorizeRequests
().
antMatchers
(
"/api/auth/**"
,
"/search/image/**"
,
"/itemStation/**"
,
"/startPage/**"
,
"/goodsType/**"
,
"/home/**"
,
"/spider/**"
,
"/store/**"
,
"/shopify/**"
,
"/community/**"
,
"/version/**"
,
"/flutterwave/notify/**"
).
permitAll
()
.
authorizeRequests
().
antMatchers
(
"/api/auth/**"
,
"/search/image/**"
,
"/itemStation/**"
,
"/startPage/**"
,
"/goodsType/**"
,
"/home/**"
,
"/spider/**"
,
"/store/**"
,
"/shopify/**"
,
"/community/**"
,
"/version/**"
,
"/flutterwave/notify/**"
,
"/dpo/notify/**"
).
permitAll
()
.
antMatchers
(
"/api/test/**"
).
permitAll
()
.
anyRequest
().
authenticated
();
...
...
src/main/java/com/example/afrishop_v3/security/services/AuthenticationUser.java
浏览文件 @
a6b686ef
package
com
.
example
.
afrishop_v3
.
security
.
services
;
import
com.example.afrishop_v3.controllers.DpoPayController
;
import
com.example.afrishop_v3.models.TbCfUserInfo
;
import
com.example.afrishop_v3.repository.UserRepository
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.stereotype.Component
;
import
java.util.Optional
;
@Component
public
class
AuthenticationUser
implements
IAuthenticationFacade
{
private
final
UserRepository
repository
;
private
final
UserRepository
repository
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AuthenticationUser
.
class
);
public
AuthenticationUser
(
UserRepository
repository
)
{
this
.
repository
=
repository
;
...
...
@@ -20,12 +25,15 @@ public class AuthenticationUser implements IAuthenticationFacade {
return
SecurityContextHolder
.
getContext
().
getAuthentication
();
}
public
TbCfUserInfo
user
(){
public
TbCfUserInfo
user
()
{
String
name
=
getAuthentication
().
getName
();
return
repository
.
findFirstByFirebaseUidOrAccount
(
name
,
name
).
orElseGet
(
null
);
// logger.info("登录的用户:" + name);
Optional
<
TbCfUserInfo
>
user
=
repository
.
findFirstByFirebaseUidOrAccount
(
name
,
name
);
// logger.info("用户:" + user);
return
user
.
isPresent
()
?
user
.
get
()
:
null
;
}
public
String
userId
(){
public
String
userId
()
{
return
user
().
getUserId
();
}
}
src/main/resources/application-dev.yml
浏览文件 @
a6b686ef
server
:
servlet
:
context-path
:
/afrishop
port
:
8099
spring
:
datasource
:
url
:
jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
...
...
@@ -14,7 +19,8 @@ spring:
upload
:
api
:
http://dev.diaosaas.com:8302/africa-shop/api/upload/uploadBase64
api
:
http://admin.afrieshop.com/api/upload/uploadBase64
#易境通物流
...
...
@@ -36,40 +42,39 @@ logistics:
#DPO相关配置
dpo
:
#创建交易请求
create
T
oken
:
createToken
create
_t
oken
:
createToken
#校验交易请求
verify
T
oken
:
verifyToken
verify
_t
oken
:
verifyToken
#取消交易请求
cancel
T
oken
:
cancelToken
cancel
_t
oken
:
cancelToken
#CompanyToken
company_token
:
9F416C11-127B-4DE2-AC7F-D5710E4C5E0A
company_token
:
E6759E15-C2F3-4526-ADEF-8FC0017BB1C4
#请求成功的状态码
success_code
:
"
000"
#DPO支付API
payment_api
:
https://secure
1.sandbox.directpay.online
/API/v6/
payment_api
:
https://secure
.3gdirectpay.com
/API/v6/
#重定向地址
redirect_url
:
https://secure
1.sandbox.directpay.online/payv2.ph
p
redirect_url
:
https://secure
.3gdirectpay.com/pay.as
p
#服务类型
service_type
:
5525
service_type
:
35711
#回调地址
notify_url
:
http
://159.138.48.71:8080/zion
/dpo/notify
notify_url
:
http
s://app.afrieshop.com/afrishop
/dpo/notify
#取消地址
back_url
:
http
://159.138.48.71:8080/zion
/dpo/cancel
back_url
:
http
s://app.afrieshop.com/afrishop
/dpo/cancel
#支付成功页面
success_url
:
https://
dev.diaosaas.com/afrishop_web
/payment_successful
success_url
:
https://
www.afrieshop.com
/payment_successful
#支付失败页面
failed_url
:
https://
dev.diaosaas.com/afrishop_web
/payment_failed
failed_url
:
https://
www.afrieshop.com
/payment_failed
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/#/PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
pay_url
:
https://
ravesandboxapi.flutterwave.com
/flwv3-pug/getpaidx/api/v2/verify
pay_url
:
https://
api.ravepay.co
/flwv3-pug/getpaidx/api/v2/verify
refund_url
:
https://api.ravepay.co/gpx/merchant/transactions/refund
redirect_url
:
http
://159.138.48.71:8080/zion
/flutterwave/notify
public_key
:
FLWPUBK
_TEST-e3cc948e7cb24b2128fca3b781f6fce0
-X
secret_key
:
FLWSECK
_TEST-f88371ca63a989a4af95625475a0d22d
-X
redirect_url
:
http
s://www.afrieshop.com/afrishop
/flutterwave/notify
public_key
:
FLWPUBK
-ee0f5d653f5f33fc89e6caf9de6a4c34
-X
secret_key
:
FLWSECK
-c06cdc19526077f3855b76045ca77de3
-X
src/main/resources/application-prod.yml
浏览文件 @
a6b686ef
server
:
servlet
:
context-path
:
/afrishop
port
:
8099
spring
:
datasource
:
url
:
jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
...
...
@@ -14,7 +19,8 @@ spring:
upload
:
api
:
http://dev.diaosaas.com:8302/africa-shop/api/upload/uploadBase64
api
:
http://admin.afrieshop.com/api/upload/uploadBase64
#易境通物流
...
...
@@ -52,23 +58,23 @@ dpo:
#服务类型
service_type
:
35711
#回调地址
notify_url
:
http
://159.138.48.71:8080/zion
/dpo/notify
notify_url
:
http
s://app.afrieshop.com/afrishop
/dpo/notify
#取消地址
back_url
:
http
://159.138.48.71:8080/zion
/dpo/cancel
back_url
:
http
s://app.afrieshop.com/afrishop
/dpo/cancel
#支付成功页面
success_url
:
https://www.afrieshop.com/payment_successful
#支付失败页面
failed_url
:
https://www.afrieshop.com/payment_failed
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/
#/
PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
pay_url
:
https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify
refund_url
:
https://api.ravepay.co/gpx/merchant/transactions/refund
redirect_url
:
http
://159.138.48.71:8080/zion
/flutterwave/notify
redirect_url
:
http
s://www.afrieshop.com/afrishop
/flutterwave/notify
public_key
:
FLWPUBK-ee0f5d653f5f33fc89e6caf9de6a4c34-X
secret_key
:
FLWSECK-c06cdc19526077f3855b76045ca77de3-X
src/main/resources/application-test.yml
浏览文件 @
a6b686ef
spring
:
datasource
:
url
:
jdbc:mysql://
47.106.242.175:3306/afrishop_test
?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
url
:
jdbc:mysql://
159.138.48.71:3306/chinafrica_ref
?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username
:
root
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
diaoyun666
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
Diaoyunnuli.8
redis
:
#Redis数据库分片索引(默认为0)
database
:
0
host
:
127.0.0.1
port
:
6379
password
:
password
:
AfriShop_date@2#!&
upload
:
api
:
http://
admin.afrieshop.com
/api/upload/uploadBase64
api
:
http://
dev.diaosaas.com:8302/africa-shop
/api/upload/uploadBase64
#易境通物流
...
...
@@ -52,23 +51,23 @@ dpo:
#服务类型
service_type
:
5525
#回调地址
notify_url
:
http
://165.22.82.105:7000/zion
/dpo/notify
notify_url
:
http
s://app.afrieshop.com/afrishop
/dpo/notify
#取消地址
back_url
:
http
://165.22.82.105:7000/zion
/dpo/cancel
back_url
:
http
s://app.afrieshop.com/afrishop
/dpo/cancel
#支付成功页面
success_url
:
https://
dev.diaosaas.com/afrishop_web
/payment_successful
success_url
:
https://
www.afrieshop.com
/payment_successful
#支付失败页面
failed_url
:
https://
dev.diaosaas.com/afrishop_web
/payment_failed
failed_url
:
https://
www.afrieshop.com
/payment_failed
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/
#/
PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
pay_url
:
https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/v2/verify
refund_url
:
https://api.ravepay.co/gpx/merchant/transactions/refund
redirect_url
:
http
://165.22.82.105:7000/zion
/flutterwave/notify
redirect_url
:
http
s://www.afrieshop.com/afrishop
/flutterwave/notify
public_key
:
FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key
:
FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
src/main/resources/application.properties
浏览文件 @
a6b686ef
server.servlet.context-path
=
/
zion
server.servlet.context-path
=
/
afrishop
spring.jpa.hibernate.ddl-auto
=
update
server.port
=
7000
server.port
=
8099
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.password=Diaoyunnuli.8
...
...
src/test/java/com/example/afrishop_v3/AfrishopV3ApplicationTests.java
浏览文件 @
a6b686ef
package
com
.
example
.
afrishop_v3
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
AfrishopV3ApplicationTests
{
@Test
void
contextLoads
()
{
}
}
//
package com.example.afrishop_v3;
//
//
import org.junit.jupiter.api.Test;
//
import org.springframework.boot.test.context.SpringBootTest;
//
//
@SpringBootTest
//
class AfrishopV3ApplicationTests {
//
//
@Test
//
void contextLoads() {
//
//
//
}
//
//
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论