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
差异被折叠。
点击展开。
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
a6b686ef
...
@@ -72,7 +72,7 @@ public class FlutterWaveController extends Controller {
...
@@ -72,7 +72,7 @@ public class FlutterWaveController extends Controller {
public
ResponseEntity
<
String
>
payForOrderByCard
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestBody
FlutterWaveCard
flutterWaveCard
)
{
public
ResponseEntity
<
String
>
payForOrderByCard
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestBody
FlutterWaveCard
flutterWaveCard
)
{
RaveConstant
.
PUBLIC_KEY
=
PUBLIC_KEY
;
RaveConstant
.
PUBLIC_KEY
=
PUBLIC_KEY
;
RaveConstant
.
SECRET_KEY
=
SECRET_KEY
;
RaveConstant
.
SECRET_KEY
=
SECRET_KEY
;
RaveConstant
.
ENVIRONMENT
=
Environment
.
LIVE
;
//or live
RaveConstant
.
ENVIRONMENT
=
Environment
.
STAGING
;
//or live
// Result result = new Result();
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
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;
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.hibernate.annotations.Formula
;
import
org.hibernate.annotations.Formula
;
import
org.hibernate.annotations.NotFound
;
import
org.hibernate.annotations.NotFound
;
import
org.hibernate.annotations.NotFoundAction
;
import
org.hibernate.annotations.NotFoundAction
;
...
@@ -21,6 +22,7 @@ import java.util.*;
...
@@ -21,6 +22,7 @@ import java.util.*;
* @author lipengjun
* @author lipengjun
* @date 2020-02-20 12:04:18
* @date 2020-02-20 12:04:18
*/
*/
@ToString
@Entity
@Entity
@Getter
@Getter
@Setter
@Setter
...
...
src/main/java/com/example/afrishop_v3/security/WebSecurityConfig.java
浏览文件 @
a6b686ef
...
@@ -65,7 +65,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -65,7 +65,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http
.
cors
().
and
().
csrf
().
disable
()
http
.
cors
().
and
().
csrf
().
disable
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
exceptionHandling
().
authenticationEntryPoint
(
unauthorizedHandler
).
and
()
.
sessionManagement
().
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
).
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
()
.
antMatchers
(
"/api/test/**"
).
permitAll
()
.
anyRequest
().
authenticated
();
.
anyRequest
().
authenticated
();
...
...
src/main/java/com/example/afrishop_v3/security/services/AuthenticationUser.java
浏览文件 @
a6b686ef
package
com
.
example
.
afrishop_v3
.
security
.
services
;
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.models.TbCfUserInfo
;
import
com.example.afrishop_v3.repository.UserRepository
;
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.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Optional
;
@Component
@Component
public
class
AuthenticationUser
implements
IAuthenticationFacade
{
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
)
{
public
AuthenticationUser
(
UserRepository
repository
)
{
this
.
repository
=
repository
;
this
.
repository
=
repository
;
...
@@ -20,12 +25,15 @@ public class AuthenticationUser implements IAuthenticationFacade {
...
@@ -20,12 +25,15 @@ public class AuthenticationUser implements IAuthenticationFacade {
return
SecurityContextHolder
.
getContext
().
getAuthentication
();
return
SecurityContextHolder
.
getContext
().
getAuthentication
();
}
}
public
TbCfUserInfo
user
(){
public
TbCfUserInfo
user
()
{
String
name
=
getAuthentication
().
getName
();
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
();
return
user
().
getUserId
();
}
}
}
}
src/main/resources/application-dev.yml
浏览文件 @
a6b686ef
server
:
servlet
:
context-path
:
/afrishop
port
:
8099
spring
:
spring
:
datasource
:
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
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:
...
@@ -14,7 +19,8 @@ spring:
upload
:
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:
...
@@ -36,40 +42,39 @@ logistics:
#DPO相关配置
#DPO相关配置
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
#CompanyToken
company_token
:
9F416C11-127B-4DE2-AC7F-D5710E4C5E0A
company_token
:
E6759E15-C2F3-4526-ADEF-8FC0017BB1C4
#请求成功的状态码
#请求成功的状态码
success_code
:
"
000"
success_code
:
"
000"
#DPO支付API
#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支付成功页面
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/#/PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
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
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
_TEST-e3cc948e7cb24b2128fca3b781f6fce0
-X
public_key
:
FLWPUBK
-ee0f5d653f5f33fc89e6caf9de6a4c34
-X
secret_key
:
FLWSECK
_TEST-f88371ca63a989a4af95625475a0d22d
-X
secret_key
:
FLWSECK
-c06cdc19526077f3855b76045ca77de3
-X
src/main/resources/application-prod.yml
浏览文件 @
a6b686ef
server
:
servlet
:
context-path
:
/afrishop
port
:
8099
spring
:
spring
:
datasource
:
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
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:
...
@@ -14,7 +19,8 @@ spring:
upload
:
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:
...
@@ -52,23 +58,23 @@ dpo:
#服务类型
#服务类型
service_type
:
35711
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
success_url
:
https://www.afrieshop.com/payment_successful
#支付失败页面
#支付失败页面
failed_url
:
https://www.afrieshop.com/payment_failed
failed_url
:
https://www.afrieshop.com/payment_failed
#WEB支付成功页面
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/
#/
PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
flutter
:
pay_url
:
https://api.ravepay.co/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
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
public_key
:
FLWPUBK-ee0f5d653f5f33fc89e6caf9de6a4c34-X
secret_key
:
FLWSECK-c06cdc19526077f3855b76045ca77de3-X
secret_key
:
FLWSECK-c06cdc19526077f3855b76045ca77de3-X
src/main/resources/application-test.yml
浏览文件 @
a6b686ef
spring
:
spring
:
datasource
:
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
username
:
root
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
password
:
diaoyun666
password
:
Diaoyunnuli.8
redis
:
redis
:
#Redis数据库分片索引(默认为0)
#Redis数据库分片索引(默认为0)
database
:
0
database
:
0
host
:
127.0.0.1
host
:
127.0.0.1
port
:
6379
port
:
6379
password
:
password
:
AfriShop_date@2#!&
upload
:
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:
...
@@ -52,23 +51,23 @@ dpo:
#服务类型
#服务类型
service_type
:
5525
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支付成功页面
#WEB支付成功页面
mobile_success_url
:
https://m.afrieshop.com/
#/
Paysuccess
mobile_success_url
:
https://m.afrieshop.com/Paysuccess
#WEB支付成功页面
#WEB支付成功页面
mobile_failed_url
:
https://m.afrieshop.com/
#/
PayFail
mobile_failed_url
:
https://m.afrieshop.com/PayFail
flutter
:
flutter
:
pay_url
:
https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/v2/verify
pay_url
:
https://ravesandboxapi.flutterwave.com/flwv3-pug/getpaidx/api/v2/verify
refund_url
:
https://api.ravepay.co/gpx/merchant/transactions/refund
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
public_key
:
FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key
:
FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-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
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.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.username=root
#spring.datasource.password=Diaoyunnuli.8
#spring.datasource.password=Diaoyunnuli.8
...
...
src/test/java/com/example/afrishop_v3/AfrishopV3ApplicationTests.java
浏览文件 @
a6b686ef
package
com
.
example
.
afrishop_v3
;
//
package com.example.afrishop_v3;
//
import
org.junit.jupiter.api.Test
;
//
import org.junit.jupiter.api.Test;
import
org.springframework.boot.test.context.SpringBootTest
;
//
import org.springframework.boot.test.context.SpringBootTest;
//
@SpringBootTest
//
@SpringBootTest
class
AfrishopV3ApplicationTests
{
//
class AfrishopV3ApplicationTests {
//
@Test
//
@Test
void
contextLoads
()
{
//
void contextLoads() {
//
//
}
//
}
//
}
//
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论