提交 33dad646 authored 作者: Whispa's avatar Whispa

commit commit

上级 3be0fd75
package com.example.afrishop_v3.config;
/**
* @Auther: wudepeng
* @Date: 2020/02/27
* @Description:DPO配置类 (正式环境)
*/
public class DpoConfig {
//创建交易请求
public final static String CREATE_TOKEN_REQUEST = "createToken";
//校验交易请求
public final static String VERIFY_TOKEN_REQUEST = "verifyToken";
//取消交易请求
public final static String CANCEL_TOKEN_REQUEST = "cancelToken";
//CompanyToken
public final static String COMPANY_TOKEN = "E6759E15-C2F3-4526-ADEF-8FC0017BB1C4";
//请求成功的状态码
public final static String SUCCESS_CODE = "000";
//DPO支付API
public final static String PAYMENT_API = "https://secure.3gdirectpay.com/API/v6/";
//重定向地址
public final static String REDIRECT_URL = "https://secure.3gdirectpay.com/pay.asp";
//服务类型
public final static String SERVICE_TYPE = "35711";
//回调地址
public final static String NOTIFY_URL = "http://159.138.48.71:8080/zion/dpo/notify";
//取消地址
public final static String BACK_URL = "http://159.138.48.71:8080/zion/dpo/cancel";
//支付成功页面
public final static String SUCCESS_URL = "https://www.afrieshop.com/payment_successful";
//支付失败页面
public final static String FAILED_URL = "https://www.afrieshop.com/payment_failed";
//支付成功页面
public final static String MOBILE_SUCCESS_URL = "https://m.afrieshop.com/#/Paysuccess";
//支付失败页面
public final static String MOBILE_FAILED_URL = "https://m.afrieshop.com/#/PayFail";
}
package com.example.afrishop_v3.config;
/**
* @Auther: wudepeng
* @Date: 2020/03/13
* @Description:DPO配置(测试环境)
*/
public class DpoConfigTest {
//创建交易请求
public final static String CREATE_TOKEN_REQUEST = "createToken";
//校验交易请求
public final static String VERIFY_TOKEN_REQUEST = "verifyToken";
//取消交易请求
public final static String CANCEL_TOKEN_REQUEST = "cancelToken";
//CompanyToken
public final static String COMPANY_TOKEN = "9F416C11-127B-4DE2-AC7F-D5710E4C5E0A";
//请求成功的状态码
public final static String SUCCESS_CODE = "000";
//DPO支付API
public final static String PAYMENT_API = "https://secure1.sandbox.directpay.online/API/v6/";
//重定向地址
public final static String REDIRECT_URL = "https://secure1.sandbox.directpay.online/payv2.php";
//回调地址
public final static String NOTIFY_URL = "http://165.22.82.105:7000/zion/dpo/notify";
//支付成功页面
public final static String SUCCESS_URL = "https://dev.diaosaas.com/afrishop_web/payment_successful";
//支付失败页面
public final static String FAILED_URL = "https://dev.diaosaas.com/afrishop_web/payment_failed";
//支付成功页面
public final static String MOBILE_SUCCESS_URL = "https://m.afrieshop.com/#/Paysuccess";
//支付失败页面
public final static String MOBILE_FAILED_URL = "https://m.afrieshop.com/#/PayFail";
//取消地址
public final static String BACK_URL = "http://165.22.82.105:7000/zion/dpo/cancel";
//服务类型
public final static Integer SERVICE_TYPE = 5525;
}
package com.example.afrishop_v3.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Auther: wudepeng
* @Date: 2020/02/27
* @Description:DPO配置类 (正式环境)
*/
@Component
@Data
@ConfigurationProperties(prefix = "dpo")
public class DpoConfiguration {
private String createToken;
private String verifyToken;
private String cancelToken;
private String companyToken;
private String successCode;
private String paymentApi;
private String redirectUrl;
private Integer serviceType;
private String notifyUrl;
private String backUrl;
private String successUrl;
private String failedUrl;
private String mobileSuccessUrl;
private String mobileFailedUrl;
public String getPaymentApi() {
return paymentApi;
}
public String getSuccessCode() {
return successCode;
}
public String getRedirectUrl() {
return redirectUrl;
}
public String getCompanyToken() {
return companyToken;
}
public String getVerifyToken() {
return verifyToken;
}
public String getCreateToken() {
return createToken;
}
public String getNotifyUrl() {
return notifyUrl;
}
public String getBackUrl() {
return backUrl;
}
public Integer getServiceType() {
return serviceType;
}
}
...@@ -2,7 +2,7 @@ package com.example.afrishop_v3.controllers; ...@@ -2,7 +2,7 @@ package com.example.afrishop_v3.controllers;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.example.afrishop_v3.base.Result; import com.example.afrishop_v3.base.Result;
import com.example.afrishop_v3.config.DpoConfig; import com.example.afrishop_v3.config.DpoConfiguration;
import com.example.afrishop_v3.enums.DeliveryStatusEnum; import com.example.afrishop_v3.enums.DeliveryStatusEnum;
import com.example.afrishop_v3.enums.OrderStatusEnum; import com.example.afrishop_v3.enums.OrderStatusEnum;
import com.example.afrishop_v3.enums.ResultCodeEnum; import com.example.afrishop_v3.enums.ResultCodeEnum;
...@@ -38,11 +38,13 @@ public class DpoPayController extends Controller { ...@@ -38,11 +38,13 @@ public class DpoPayController extends Controller {
private final TbCfOrderRepository repository; private final TbCfOrderRepository repository;
private final TbCfFinanceRepository financeRepository; private final TbCfFinanceRepository financeRepository;
private final AuthenticationUser user; private final AuthenticationUser user;
private final DpoConfiguration config;
public DpoPayController(TbCfOrderRepository repository, TbCfFinanceRepository financeRepository, AuthenticationUser user) { public DpoPayController(TbCfOrderRepository repository, TbCfFinanceRepository financeRepository, AuthenticationUser user, DpoConfiguration config) {
this.repository = repository; this.repository = repository;
this.financeRepository = financeRepository; this.financeRepository = financeRepository;
this.user = user; this.user = user;
this.config = config;
} }
...@@ -98,7 +100,7 @@ public class DpoPayController extends Controller { ...@@ -98,7 +100,7 @@ public class DpoPayController extends Controller {
Map<String, Object> map = getParameters(transToken); Map<String, Object> map = getParameters(transToken);
String mapToXml = DataUtils.multilayerMapToXml(map, false); String mapToXml = DataUtils.multilayerMapToXml(map, false);
mapToXml = mapToXml.replaceAll("<xml>", "").replaceAll("</xml>", ""); mapToXml = mapToXml.replaceAll("<xml>", "").replaceAll("</xml>", "");
String resp = (String) HttpsUtil.sendHttps(DpoConfig.PAYMENT_API, "POST", mapToXml, false); String resp = (String) HttpsUtil.sendHttps(config.getPaymentApi(), "POST", mapToXml, false);
if (resp != null) { if (resp != null) {
//将响应结果转成json格式 //将响应结果转成json格式
String json = DataUtils.xml2json(resp); String json = DataUtils.xml2json(resp);
...@@ -106,7 +108,7 @@ public class DpoPayController extends Controller { ...@@ -106,7 +108,7 @@ public class DpoPayController extends Controller {
JSONObject api3G = jsonObject.getJSONObject("API3G"); JSONObject api3G = jsonObject.getJSONObject("API3G");
String resCode = api3G.getString("Result"); String resCode = api3G.getString("Result");
//校验交易状态码 //校验交易状态码
if (DpoConfig.SUCCESS_CODE.equals(resCode)) { if (config.getSuccessCode().equals(resCode)) {
TbCfUserInfo user = this.user.user(); TbCfUserInfo user = this.user.user();
if( user.hasFcm() ){ if( user.hasFcm() ){
sendNotification(user.getFcm(), "Order alert !!", "Order of $" + order.getRealityPay() + " has been successfully paid !!"); sendNotification(user.getFcm(), "Order alert !!", "Order of $" + order.getRealityPay() + " has been successfully paid !!");
...@@ -128,7 +130,7 @@ public class DpoPayController extends Controller { ...@@ -128,7 +130,7 @@ public class DpoPayController extends Controller {
tbCfToiCouponDao.changeCoupnStatus(tbCfOrderVo.getUserId(), tbCfOrderVo.getCouponId()); tbCfToiCouponDao.changeCoupnStatus(tbCfOrderVo.getUserId(), tbCfOrderVo.getCouponId());
}*/ }*/
//3.生成支付明细 //3.生成支付明细
String authurl = DpoConfig.REDIRECT_URL + "?ID=" + transToken; String authurl = config.getRedirectUrl() + "?ID=" + transToken;
TbCfFinance finance = createFinance(transToken, authurl, order); TbCfFinance finance = createFinance(transToken, authurl, order);
// TbCfFinanceVo tbCfFinanceVo = new TbCfFinanceVo(); // TbCfFinanceVo tbCfFinanceVo = new TbCfFinanceVo();
// BeanUtils.copyProperties(finance, tbCfFinanceVo); // BeanUtils.copyProperties(finance, tbCfFinanceVo);
...@@ -212,7 +214,7 @@ public class DpoPayController extends Controller { ...@@ -212,7 +214,7 @@ public class DpoPayController extends Controller {
Map<String, Object> map = getParameters(order); Map<String, Object> map = getParameters(order);
String mapToXml = DataUtils.multilayerMapToXml(map, false); String mapToXml = DataUtils.multilayerMapToXml(map, false);
mapToXml = mapToXml.replaceAll("<xml>", "").replaceAll("</xml>", ""); mapToXml = mapToXml.replaceAll("<xml>", "").replaceAll("</xml>", "");
String resp = (String) HttpsUtil.sendHttps(DpoConfig.PAYMENT_API, "POST", mapToXml, false); String resp = (String) HttpsUtil.sendHttps(config.getPaymentApi(), "POST", mapToXml, false);
if (resp != null) { if (resp != null) {
//将响应结果转成json格式 //将响应结果转成json格式
String json = DataUtils.xml2json(resp); String json = DataUtils.xml2json(resp);
...@@ -220,10 +222,10 @@ public class DpoPayController extends Controller { ...@@ -220,10 +222,10 @@ public class DpoPayController extends Controller {
JSONObject api3G = jsonObject.getJSONObject("API3G"); JSONObject api3G = jsonObject.getJSONObject("API3G");
String resCode = api3G.getString("Result"); String resCode = api3G.getString("Result");
String transToken = api3G.getString("TransToken"); String transToken = api3G.getString("TransToken");
if (DpoConfig.SUCCESS_CODE.equals(resCode)) { if (config.getSuccessCode().equals(resCode)) {
HashMap<String,Object> resultMap = new HashMap<>(); HashMap<String,Object> resultMap = new HashMap<>();
resultMap.put("transToken", transToken); resultMap.put("transToken", transToken);
resultMap.put("payUrl", DpoConfig.REDIRECT_URL + "?ID=" + transToken); resultMap.put("payUrl", config.getRedirectUrl() + "?ID=" + transToken);
resultMap.put("orderInfo", order); resultMap.put("orderInfo", order);
// result.setData(resultMap); // result.setData(resultMap);
// logger.info("DPO支付:订单号" + orderId + "创建令牌成功"); // logger.info("DPO支付:订单号" + orderId + "创建令牌成功");
...@@ -240,8 +242,8 @@ public class DpoPayController extends Controller { ...@@ -240,8 +242,8 @@ public class DpoPayController extends Controller {
private Map<String, Object> getParameters(String transToken) { private Map<String, Object> getParameters(String transToken) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
Map<String, Object> apiMap = new HashMap<>(); Map<String, Object> apiMap = new HashMap<>();
apiMap.put("CompanyToken", DpoConfig.COMPANY_TOKEN); apiMap.put("CompanyToken", config.getCompanyToken());
apiMap.put("Request", DpoConfig.VERIFY_TOKEN_REQUEST); apiMap.put("Request", config.getVerifyToken());
apiMap.put("TransactionToken", transToken); apiMap.put("TransactionToken", transToken);
paramMap.put("API3G", apiMap); paramMap.put("API3G", apiMap);
return paramMap; return paramMap;
...@@ -252,33 +254,33 @@ public class DpoPayController extends Controller { ...@@ -252,33 +254,33 @@ public class DpoPayController extends Controller {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
Map<String, Object> apiMap = new HashMap<>(); Map<String, Object> apiMap = new HashMap<>();
Map<String, Object> tranMap = new HashMap<>(); Map<String, Object> tranMap = new HashMap<>();
tranMap.put("Request", DpoConfig.CREATE_TOKEN_REQUEST); tranMap.put("Request", config.getCreateToken());
tranMap.put("PaymentAmount", order.getRealityPay().setScale(2, BigDecimal.ROUND_UP)); tranMap.put("PaymentAmount", order.getRealityPay().setScale(2, BigDecimal.ROUND_UP));
tranMap.put("PaymentCurrency", "USD"); tranMap.put("PaymentCurrency", "USD");
tranMap.put("CompanyRef", order.getOrderId()); tranMap.put("CompanyRef", order.getOrderId());
tranMap.put("CompanyRefUnique", 0); tranMap.put("CompanyRefUnique", 0);
//回调地址 //回调地址
if (order.getOrderSource() != null && "1".equals(order.getOrderSource().toString())) { if (order.getOrderSource() != null && "1".equals(order.getOrderSource().toString())) {
tranMap.put("RedirectURL", DpoConfig.NOTIFY_URL); tranMap.put("RedirectURL", config.getNotifyUrl());
} else if (order.getOrderSource() != null && "2".equals(order.getOrderSource().toString())) { } else if (order.getOrderSource() != null && "2".equals(order.getOrderSource().toString())) {
tranMap.put("RedirectURL", DpoConfig.NOTIFY_URL + "/web"); tranMap.put("RedirectURL", config.getNotifyUrl() + "/web");
} else if (order.getOrderSource() != null && "3".equals(order.getOrderSource().toString())) { } else if (order.getOrderSource() != null && "3".equals(order.getOrderSource().toString())) {
tranMap.put("RedirectURL", DpoConfig.NOTIFY_URL + "/mobile"); tranMap.put("RedirectURL", config.getNotifyUrl() + "/mobile");
} }
System.out.println("回调地址:" + tranMap.get("RedirectURL")); System.out.println("回调地址:" + tranMap.get("RedirectURL"));
//取消地址 //取消地址
tranMap.put("BackURL", DpoConfig.BACK_URL); tranMap.put("BackURL", config.getBackUrl());
// tranMap.put("PTL", 5); // tranMap.put("PTL", 5);
Map<String, Object> servicesMap = new HashMap<>(); Map<String, Object> servicesMap = new HashMap<>();
Map<String, Object> serviceMap = new HashMap<>(); Map<String, Object> serviceMap = new HashMap<>();
serviceMap.put("ServiceType", DpoConfig.SERVICE_TYPE); serviceMap.put("ServiceType", config.getServiceType());
serviceMap.put("ServiceDescription", "DPO payment,name:" + order.getUserName() + ",amount:$" + order.getRealityPay()); serviceMap.put("ServiceDescription", "DPO payment,name:" + order.getUserName() + ",amount:$" + order.getRealityPay());
serviceMap.put("ServiceDate", dateFormat.format(new Date())); serviceMap.put("ServiceDate", dateFormat.format(new Date()));
servicesMap.put("Service", serviceMap); servicesMap.put("Service", serviceMap);
apiMap.put("Transaction", tranMap); apiMap.put("Transaction", tranMap);
apiMap.put("Services", servicesMap); apiMap.put("Services", servicesMap);
apiMap.put("CompanyToken", DpoConfig.COMPANY_TOKEN); apiMap.put("CompanyToken", config.getCompanyToken());
apiMap.put("Request", DpoConfig.CREATE_TOKEN_REQUEST); apiMap.put("Request", config.getCreateToken());
paramMap.put("API3G", apiMap); paramMap.put("API3G", apiMap);
return paramMap; return paramMap;
} }
......
...@@ -19,6 +19,7 @@ import com.example.afrishop_v3.util.IdUtil; ...@@ -19,6 +19,7 @@ import com.example.afrishop_v3.util.IdUtil;
import org.json.JSONObject; import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -33,28 +34,41 @@ public class FlutterWaveController extends Controller { ...@@ -33,28 +34,41 @@ public class FlutterWaveController extends Controller {
private final TbCfOrderRepository repository; private final TbCfOrderRepository repository;
private final TbCfFinanceRepository financeRepository; private final TbCfFinanceRepository financeRepository;
private final UserRepository userRepository; private final UserRepository userRepository;
private final DomainProperties domainProperties; // private final DomainProperties domainProperties;
private final AuthenticationUser user; private final AuthenticationUser user;
@Value("${flutter.refund_url}")
private String FLUTTERWAVE_REFUND_URL;
//退款API //校验API
private String FLUTTERWAVE_REFUND_URL = "https://api.ravepay.co/gpx/merchant/transactions/refund"; @Value("${flutter.pay_url}")
private String VERIFY_PAY_URL;
// //校验API @Value("${flutter.public_key}")
private String VERIFY_PAY_URL = "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify"; private String PUBLIC_KEY;
public FlutterWaveController(TbCfOrderRepository repository, TbCfFinanceRepository financeRepository, UserRepository userRepository, DomainProperties domainProperties, AuthenticationUser user) { @Value("${flutter.secret_key}")
private String SECRET_KEY;
// //退款API
// private String FLUTTERWAVE_REFUND_URL = "https://api.ravepay.co/gpx/merchant/transactions/refund";
//
// // //校验API
// private String VERIFY_PAY_URL = "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify";
public FlutterWaveController(TbCfOrderRepository repository, TbCfFinanceRepository financeRepository, UserRepository userRepository, AuthenticationUser user) {
this.repository = repository; this.repository = repository;
this.financeRepository = financeRepository; this.financeRepository = financeRepository;
this.userRepository = userRepository; this.userRepository = userRepository;
this.domainProperties = domainProperties; // this.domainProperties = domainProperties;
this.user = user; this.user = user;
} }
@PostMapping("/pay") @PostMapping("/pay")
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 = domainProperties.getProperty("flutterwave.public.key"); RaveConstant.PUBLIC_KEY = PUBLIC_KEY;
RaveConstant.SECRET_KEY = domainProperties.getProperty("flutterwave.secret.key"); RaveConstant.SECRET_KEY = SECRET_KEY;
RaveConstant.ENVIRONMENT = Environment.LIVE; //or live RaveConstant.ENVIRONMENT = Environment.LIVE; //or live
// Result result = new Result(); // Result result = new Result();
Optional<TbCfOrder> byId = repository.findById(orderId); Optional<TbCfOrder> byId = repository.findById(orderId);
...@@ -123,7 +137,7 @@ public class FlutterWaveController extends Controller { ...@@ -123,7 +137,7 @@ public class FlutterWaveController extends Controller {
TbCfOrder tbCfOrderVo = byId.get(); TbCfOrder tbCfOrderVo = byId.get();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("txref", orderId); map.put("txref", orderId);
map.put("SECKEY", domainProperties.getProperty("flutterwave.secret.key")); map.put("SECKEY", SECRET_KEY);
String data = HttpClientUtil.sendPostWithBodyParameter(VERIFY_PAY_URL, map); String data = HttpClientUtil.sendPostWithBodyParameter(VERIFY_PAY_URL, map);
com.alibaba.fastjson.JSONObject object = JSON.parseObject(data); com.alibaba.fastjson.JSONObject object = JSON.parseObject(data);
String statusFlag = object.getString("status"); String statusFlag = object.getString("status");
...@@ -204,7 +218,7 @@ public class FlutterWaveController extends Controller { ...@@ -204,7 +218,7 @@ public class FlutterWaveController extends Controller {
@PostMapping("/refund") @PostMapping("/refund")
public Result refund(@RequestBody FlutterWaveCard flutterWaveCard) { public Result refund(@RequestBody FlutterWaveCard flutterWaveCard) {
Result result = new Result(); Result result = new Result();
RaveConstant.SECRET_KEY = domainProperties.getProperty("flutterwave.secret.key"); RaveConstant.SECRET_KEY = SECRET_KEY;
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("ref", flutterWaveCard.getRef()); params.put("ref", flutterWaveCard.getRef());
params.put("seckey", RaveConstant.SECRET_KEY); params.put("seckey", RaveConstant.SECRET_KEY);
...@@ -247,7 +261,7 @@ public class FlutterWaveController extends Controller { ...@@ -247,7 +261,7 @@ public class FlutterWaveController extends Controller {
Result result = new Result<>(); Result result = new Result<>();
List<TbCfUserInfo> list = new ArrayList<>(); List<TbCfUserInfo> list = new ArrayList<>();
FlutterKey key = new FlutterKey(); FlutterKey key = new FlutterKey();
String public_key = domainProperties.getProperty("flutterwave.public.key"); String public_key = PUBLIC_KEY;
list.add(userInfo); list.add(userInfo);
key.setPublic_key(public_key); key.setPublic_key(public_key);
......
...@@ -5,6 +5,7 @@ import com.example.afrishop_v3.enums.ResultCodeEnum; ...@@ -5,6 +5,7 @@ import com.example.afrishop_v3.enums.ResultCodeEnum;
import com.example.afrishop_v3.models.*; import com.example.afrishop_v3.models.*;
import com.example.afrishop_v3.repository.*; import com.example.afrishop_v3.repository.*;
import com.example.afrishop_v3.security.services.AuthenticationUser; import com.example.afrishop_v3.security.services.AuthenticationUser;
import com.example.afrishop_v3.util.OssUtil;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
...@@ -251,19 +252,31 @@ public class PostController { ...@@ -251,19 +252,31 @@ public class PostController {
// Path store = storageService.store(file); // Path store = storageService.store(file);
// String string = MvcUriComponentsBuilder.fromMethodName(FileUploadController.class, // String string = MvcUriComponentsBuilder.fromMethodName(FileUploadController.class,
// "serveFile", store.getFileName().toString()).build().toUri().toString(); // "serveFile", store.getFileName().toString()).build().toUri().toString();
String string = UploadController.sendFile(sb.toString(), api); String string = null;
try {
string = OssUtil.upload(file,"discover");
} catch (Exception e) {
System.out.println(e.getMessage());
continue;
}
thumbList.add(string); thumbList.add(string);
} }
} }
if (files != null) { if (files != null) {
for (MultipartFile file : files) { for (MultipartFile file : files) {
StringBuilder sb = new StringBuilder(); //StringBuilder sb = new StringBuilder();
sb.append("data:image/png;base64,"); // sb.append("data:image/png;base64,");
sb.append(StringUtils.newStringUtf8(Base64.encodeBase64(file.getBytes()))); //sb.append(StringUtils.newStringUtf8(Base64.encodeBase64(file.getBytes())));
// Path store = storageService.store(file); // Path store = storageService.store(file);
// String string = MvcUriComponentsBuilder.fromMethodName(FileUploadController.class, // String string = MvcUriComponentsBuilder.fromMethodName(FileUploadController.class,
// "serveFile", store.getFileName().toString()).build().toUri().toString(); // "serveFile", store.getFileName().toString()).build().toUri().toString();
String string = UploadController.sendFile(sb.toString(), api); String string = null;
try {
string = OssUtil.upload(file,"discover");
} catch (Exception e) {
System.out.println(e.getMessage());
continue;
}
list.add(string); list.add(string);
Content content = new Content(); Content content = new Content();
content.setPost(post); content.setPost(post);
......
spring:
datasource:
url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
driver-class-name: com.mysql.cj.jdbc.Driver
password: Diaoyunnuli.8
redis:
#Redis数据库分片索引(默认为0)
database: 0
host: 159.138.33.0
port: 6379
password: AfriShop_date@2#!&
upload:
api: http://dev.diaosaas.com:8302/africa-shop/api/upload/uploadBase64
#易境通物流
logistics:
#客户编号
user: shd806
#客户密钥
token: d44426bd5b64dd2
#添加物流订单API
add_order: http://shd.kjwlxt.com/api/api_order_add.php
#物流轨迹API
track: http://shd.kjwlxt.com/api/track.php
#已签收API
sign: http://shd.kjwlxt.com/api/checkout.php
#入库API
stock: http://shd.kjwlxt.com/api/checkin.php
#DPO相关配置
dpo:
#创建交易请求
create_token: createToken
#校验交易请求
verify_token: verifyToken
#取消交易请求
cancel_token: cancelToken
#CompanyToken
company_token: E6759E15-C2F3-4526-ADEF-8FC0017BB1C4
#请求成功的状态码
success_code: "000"
#DPO支付API
payment_api: https://secure.3gdirectpay.com/API/v6/
#重定向地址
redirect_url: https://secure.3gdirectpay.com/pay.asp
#服务类型
service_type: 35711
#回调地址
notify_url: https://app.afrieshop.com/zion/dpo/notify
#取消地址
back_url: https://app.afrieshop.com/zion/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
#WEB支付成功页面
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
public_key: FLWPUBK-ee0f5d653f5f33fc89e6caf9de6a4c34-X
secret_key: FLWSECK-c06cdc19526077f3855b76045ca77de3-X
spring:
datasource:
url: jdbc:mysql://159.138.48.71:3306/chinafrica_ref?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
driver-class-name: com.mysql.cj.jdbc.Driver
password: Diaoyunnuli.8
redis:
#Redis数据库分片索引(默认为0)
database: 0
host: 159.138.33.0
port: 6379
password: AfriShop_date@2#!&
upload:
api: http://dev.diaosaas.com:8302/africa-shop/api/upload/uploadBase64
#易境通物流
logistics:
#客户编号
user: shd806
#客户密钥
token: d44426bd5b64dd2
#添加物流订单API
add_order: http://shd.kjwlxt.com/api/api_order_add.php
#物流轨迹API
track: http://shd.kjwlxt.com/api/track.php
#已签收API
sign: http://shd.kjwlxt.com/api/checkout.php
#入库API
stock: http://shd.kjwlxt.com/api/checkin.php
#DPO相关配置
dpo:
#创建交易请求
create_token: createToken
#校验交易请求
verify_token: verifyToken
#取消交易请求
cancel_token: cancelToken
#CompanyToken
company_token: E6759E15-C2F3-4526-ADEF-8FC0017BB1C4
#请求成功的状态码
success_code: "000"
#DPO支付API
payment_api: https://secure.3gdirectpay.com/API/v6/
#重定向地址
redirect_url: https://secure.3gdirectpay.com/pay.asp
#服务类型
service_type: 35711
#回调地址
notify_url: https://app.afrieshop.com/zion/dpo/notify
#取消地址
back_url: https://app.afrieshop.com/zion/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
#WEB支付成功页面
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
public_key: FLWPUBK-ee0f5d653f5f33fc89e6caf9de6a4c34-X
secret_key: FLWSECK-c06cdc19526077f3855b76045ca77de3-X
spring:
datasource:
url: jdbc:mysql://47.106.242.175:3306/afrishop_test?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
username: root
driver-class-name : com.mysql.cj.jdbc.Driver
password: diaoyun666
redis:
#Redis数据库分片索引(默认为0)
database: 0
host: 127.0.0.1
port: 6379
password:
upload:
api: http://admin.afrieshop.com/api/upload/uploadBase64
#易境通物流
logistics:
#客户编号
user: shd806
#客户密钥
token: d44426bd5b64dd2
#添加物流订单API
add_order: http://shd.kjwlxt.com/api/api_order_add.php
#物流轨迹API
track: http://shd.kjwlxt.com/api/track.php
#已签收API
sign: http://shd.kjwlxt.com/api/checkout.php
#入库API
stock: http://shd.kjwlxt.com/api/checkin.php
#DPO相关配置
dpo:
#创建交易请求
createToken: createToken
#校验交易请求
verifyToken: verifyToken
#取消交易请求
cancelToken: cancelToken
#CompanyToken
company_token: 9F416C11-127B-4DE2-AC7F-D5710E4C5E0A
#请求成功的状态码
success_code: "000"
#DPO支付API
payment_api: https://secure1.sandbox.directpay.online/API/v6/
#重定向地址
redirect_url: https://secure1.sandbox.directpay.online/payv2.php
#服务类型
service_type: 5525
#回调地址
notify_url: https://dev.diaosaas.com/zion/dpo/notify
#取消地址
back_url: https://dev.diaosaas.com/zion/dpo/cancel
#支付成功页面
success_url: https://dev.diaosaas.com/afrishop_web/payment_successful
#支付失败页面
failed_url: https://dev.diaosaas.com/afrishop_web/payment_failed
#WEB支付成功页面
mobile_success_url: https://m.afrieshop.com/#/Paysuccess
#WEB支付成功页面
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
public_key: FLWPUBK_TEST-e3cc948e7cb24b2128fca3b781f6fce0-X
secret_key: FLWSECK_TEST-f88371ca63a989a4af95625475a0d22d-X
server.servlet.context-path=/zion server.servlet.context-path=/zion
spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.ddl-auto=update
server.port = 7000 server.port = 7000
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/chinafrica_ref?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
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect #spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.profiles.active=test
spring.datasource.connectionInitSql: SET NAMES 'utf8mb4' spring.datasource.connectionInitSql: SET NAMES 'utf8mb4'
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect #spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
security.oauth2.resource.filter-order=3 security.oauth2.resource.filter-order=3
...@@ -20,23 +21,10 @@ security.jwt.scope-write=write ...@@ -20,23 +21,10 @@ security.jwt.scope-write=write
security.jwt.resource-ids=testjwtresourceid security.jwt.resource-ids=testjwtresourceid
spring.servlet.multipart.max-file-size=456128KB spring.servlet.multipart.max-file-size=456128KB
spring.servlet.multipart.max-request-size=456128KB spring.servlet.multipart.max-request-size=456128KB
logistics.user = shd806
#????
logistics.token = d44426bd5b64dd2
#??????API
logistics.add_order = http://shd.kjwlxt.com/api/api_order_add.php
#????API
logistics.track = http://shd.kjwlxt.com/api/track.php
#???API
logistics.sign = http://shd.kjwlxt.com/api/checkout.php
#??API
logistics.stock = http://shd.kjwlxt.com/api/checkin.php
# App Properties # App Properties
bezkoder.app.jwtSecret= bezKoderSecretKey bezkoder.app.jwtSecret= bezKoderSecretKey
bezkoder.app.jwtExpirationMs= 86400000 bezkoder.app.jwtExpirationMs= 86400000
upload.api = http://dev.diaosaas.com:8302/africa-shop/api/upload/uploadBase64
# upload.api = http://admin.afrieshop.com/api/upload/uploadBase64
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论