Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
95227396
提交
95227396
authored
3月 01, 2021
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Braintree支付
上级
e06c27d7
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
18 行增加
和
7 行删除
+18
-7
BraintreeController.java
.../example/afrishop_v3/controllers/BraintreeController.java
+6
-4
FlutterWaveController.java
...xample/afrishop_v3/controllers/FlutterWaveController.java
+2
-2
ItemController.java
...a/com/example/afrishop_v3/controllers/ItemController.java
+2
-1
OrderController.java
.../com/example/afrishop_v3/controllers/OrderController.java
+2
-0
TbCfOrder.java
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
+3
-0
ActivityRepository.java
...om/example/afrishop_v3/repository/ActivityRepository.java
+3
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/BraintreeController.java
浏览文件 @
95227396
...
...
@@ -5,12 +5,10 @@ import com.braintreegateway.*;
import
com.example.afrishop_v3.models.TbCfOrder
;
import
com.example.afrishop_v3.repository.TbCfOrderRepository
;
import
com.example.afrishop_v3.util.GatewayFactory
;
import
net.sf.json.JSONObject
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -25,6 +23,7 @@ import java.util.Optional;
* @Description:Braintree支付
*/
@RestController
@RequestMapping
(
"/braintree"
)
public
class
BraintreeController
{
private
static
BraintreeGateway
gateway
=
GatewayFactory
.
getlisiGateway
();
...
...
@@ -70,6 +69,9 @@ public class BraintreeController {
.
done
();
Result
<
Transaction
>
result
=
gateway
.
transaction
().
sale
(
request
);
System
.
err
.
println
(
JSONObject
.
fromObject
(
result
));
System
.
out
.
println
(
"============================================="
);
System
.
out
.
println
(
"支付状态:"
+
result
.
isSuccess
());
if
(
result
.
isSuccess
())
{
resp
.
sendRedirect
(
PAYPAL_SUCCESS_PAGE
);
...
...
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
95227396
...
...
@@ -81,7 +81,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 STAGING
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
...
...
@@ -135,7 +135,7 @@ public class FlutterWaveController extends Controller {
public
ResponseEntity
<
String
>
payForOrderByPhone
(
@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 STAGING
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
...
...
src/main/java/com/example/afrishop_v3/controllers/ItemController.java
浏览文件 @
95227396
...
...
@@ -283,7 +283,8 @@ public class ItemController {
// }
String
nick
=
c
.
getUserName
();
String
newNick
=
nick
.
substring
(
0
,
1
)
+
"***"
+
nick
.
substring
(
nick
.
length
()
-
1
);
// String newNick = nick.substring(0, 1) + "***" + nick.substring(nick.length() - 1);
String
newNick
=
String
.
format
(
"%s***%s"
,
nick
.
charAt
(
0
),
nick
.
charAt
(
nick
.
length
()
-
1
));
c
.
setUserName
(
newNick
);
if
(!
StringUtils
.
isBlank
(
userId
))
{
String
liked
=
(
String
)
redisCache
.
get
(
key
+
userId
+
"_"
+
c
.
getId
());
...
...
src/main/java/com/example/afrishop_v3/controllers/OrderController.java
浏览文件 @
95227396
...
...
@@ -176,6 +176,8 @@ public class OrderController extends Controller {
// order.setCoupon(coupon);
// }
// }
boolean
exists
=
activityRepository
.
existsByStatus
(
1
);
order
.
setHasActivity
(
exists
);
order
.
setOpen
(
open
);
order
.
setCouponMap
(
map
);
order
.
getItemOrderListFromCartList
(
list
,
itemRepository
,
activityRepository
);
...
...
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
浏览文件 @
95227396
...
...
@@ -180,6 +180,9 @@ public class TbCfOrder {
@Transient
private
boolean
open
=
false
;
@Transient
private
boolean
hasActivity
;
public
Map
<
String
,
Object
>
getCouponMap
()
{
return
couponMap
;
}
...
...
src/main/java/com/example/afrishop_v3/repository/ActivityRepository.java
浏览文件 @
95227396
...
...
@@ -30,4 +30,7 @@ public interface ActivityRepository extends JpaRepository<Activity, String> {
@Query
(
value
=
"select * from Activity a where CURRENT_TIMESTAMP between a.start_time and a.end_time and a.status=1 and a.use_type=:useType order by a.create_time desc "
,
nativeQuery
=
true
)
List
<
Activity
>
findAllByUseType
(
Integer
useType
);
boolean
existsByStatus
(
Integer
status
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论