提交 a6b686ef authored 作者: 吴德鹏's avatar 吴德鹏

update dpo

上级 64f4033f
...@@ -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);
......
...@@ -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
......
...@@ -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();
......
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();
} }
} }
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:
#创建交易请求 #创建交易请求
createToken: createToken create_token: createToken
#校验交易请求 #校验交易请求
verifyToken: verifyToken verify_token: verifyToken
#取消交易请求 #取消交易请求
cancelToken: cancelToken cancel_token: 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://secure1.sandbox.directpay.online/API/v6/ payment_api: https://secure.3gdirectpay.com/API/v6/
#重定向地址 #重定向地址
redirect_url: https://secure1.sandbox.directpay.online/payv2.php redirect_url: https://secure.3gdirectpay.com/pay.asp
#服务类型 #服务类型
service_type: 5525 service_type: 35711
#回调地址 #回调地址
notify_url: http://159.138.48.71:8080/zion/dpo/notify notify_url: https://app.afrieshop.com/afrishop/dpo/notify
#取消地址 #取消地址
back_url: http://159.138.48.71:8080/zion/dpo/cancel back_url: https://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: https://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
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: https://app.afrieshop.com/afrishop/dpo/notify
#取消地址 #取消地址
back_url: http://159.138.48.71:8080/zion/dpo/cancel back_url: https://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: https://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
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: https://app.afrieshop.com/afrishop/dpo/notify
#取消地址 #取消地址
back_url: http://165.22.82.105:7000/zion/dpo/cancel back_url: https://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: https://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
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
......
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论